fix(multicursor): 'autocomplete' during insert-cascade raises E565 #41625

Problem:
With mcursors and 'autocomplete', a non-literal key (`<BS>`) during an
active completion attempts to insert-cascade, which attempts a nested
`edit()`, which refuses with E565.

Solution:
Defer the flush while completion is active; the pending keys will be
handled later.
This commit is contained in:
Justin M. Keyes
2026-09-02 11:20:55 -04:00
committed by GitHub
parent 80e9708afa
commit c75aae2bfb
5 changed files with 40 additions and 24 deletions

View File

@@ -1401,6 +1401,17 @@ describe('multicursor', function()
feed('cc')
feed('f<C-n><C-n><C-e><Esc>') -- cycle, then cancel back to the leader
eq({ 'f', 'f', 'f' }, { get_lines()[4], get_lines()[5], get_lines()[6] })
-- No candidates, {Visual}Q cursors: <BS> mid-completion. #41602
clear_cursors()
api.nvim_buf_set_lines(0, 0, -1, true, { '', '', '' })
command('let v:errmsg = ""')
feed('VggQ')
feed('i a<BS>')
eq('', api.nvim_get_vvar('errmsg'))
feed('<Esc>')
eq('', api.nvim_get_vvar('errmsg'))
eq({ ' ', ' ', ' ' }, get_lines())
end)
it('InsertCharPre-driven complete() plugin (cmp-style)', function()