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

@@ -515,7 +515,7 @@ end
function M.choose(side)
local bufnr = api.nvim_get_current_buf()
if vim.fn.mode() == "v" or vim.fn.mode() == "V" or vim.fn.mode() == "" then
api.nvim_feedkeys(api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
vim.cmd("noautocmd stopinsert")
-- have to defer so that the < and > marks are set
vim.defer_fn(function()
local start = api.nvim_buf_get_mark(0, "<")[1]