mirror of
https://github.com/akinsho/toggleterm.nvim
synced 2024-09-16 21:34:03 +02:00
fix: set_mode may not be taken into account (#596)
This commit is contained in:
parent
7844d73fba
commit
137d06fb10
1 changed files with 3 additions and 3 deletions
|
@ -261,11 +261,11 @@ function Terminal:__restore_mode() self:set_mode(self.__state.mode) end
|
|||
---@param m Mode
|
||||
function Terminal:set_mode(m)
|
||||
if m == mode.INSERT then
|
||||
vim.cmd("startinsert")
|
||||
vim.schedule(function() vim.cmd("startinsert") end)
|
||||
elseif m == mode.NORMAL then
|
||||
vim.cmd("stopinsert")
|
||||
vim.schedule(function() vim.cmd("stopinsert") end)
|
||||
elseif m == mode.UNSUPPORTED and config.get("start_in_insert") then
|
||||
vim.cmd("startinsert")
|
||||
vim.schedule(function() vim.cmd("startinsert") end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue