chores: use stopinsert (#1745)

This commit is contained in:
yetone
2025-03-28 00:17:01 +08:00
committed by GitHub
parent cfc5a78813
commit a9b01e766e
6 changed files with 14 additions and 17 deletions

View File

@@ -129,14 +129,14 @@ function PromptInput:open()
self:setup_keymaps()
self:setup_autocmds()
if self.start_insert then vim.cmd([[startinsert!]]) end
if self.start_insert then vim.cmd("noautocmd startinsert!") end
end
function PromptInput:close()
if not self.bufnr then return end
self:stop_spinner()
self:close_shortcuts_hints()
if api.nvim_get_mode().mode == "i" then vim.cmd([[stopinsert]]) end
if api.nvim_get_mode().mode == "i" then vim.cmd("noautocmd stopinsert") end
if self.winid and api.nvim_win_is_valid(self.winid) then
api.nvim_win_close(self.winid, true)
self.winid = nil