fix(cmdline): avoid 'incsearch' recursion after redraw #39303

Problem:  A vim.ui_attach() callback that redraws to show a 'verbose'
          regex message during 'incsearch' results in recusive redrawing.

Solution: Check that curwin was redrawn instead of just any window when
          determining if 'incsearch' highlighting was cleared.
This commit is contained in:
luukvbaal
2026-04-22 15:04:20 +02:00
committed by GitHub
parent 2ca31eddae
commit 61fb88992d
4 changed files with 17 additions and 2 deletions

View File

@@ -263,6 +263,18 @@ describe('cmdline2', function()
]])
t.eq({ CmdlineChanged = 1, CursorMovedC = 1 }, exec_lua('return _G.events'))
end)
it("no 'incsearch' recursion with 'verbose' regex message", function()
exec('set verbose=1')
feed([[:%s/.\{//}]])
screen:expect([[
|
{1:~ }|*9
{3: }|
Switching to backtracking RE engine for pattern: .\{ |*2
{16::}%{15:s}{16:/.\{//}^ } |
]])
end)
end)
describe('cmdline2', function()