Skip to content

Commit

Permalink
fix: set_mode may not be taken into account (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
pipoprods committed Aug 8, 2024
1 parent 7844d73 commit 137d06f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/toggleterm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 137d06f

Please # to comment.