Fix: double q exit visual mode

This commit is contained in:
hyzen
2026-06-28 09:24:21 +05:30
parent fbf75ac3ed
commit 44b6eae6f6

View File

@@ -733,6 +733,17 @@ local function flush_pending_q_before(ch)
end
return false
end
vim.api.nvim_create_autocmd('ModeChanged', {
pattern = '*:*',
callback = function()
if q_pending and not vim.api.nvim_get_mode().mode:match '[vV\x16]' then
q_timer:stop()
q_timer:close()
q_timer = nil
q_pending = false
end
end,
})
for i = 32, 126 do
local ch = string.char(i)
if ch ~= 'q' then