From cb036cae5fb1ab0fb699436d2dbbc3295657967e Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Fri, 6 Jun 2025 16:04:45 +0200 Subject: fix(extui): use visible to determine active "more" (#34327) Problem: Current window is checked to determine whether "more" window is open. Making it the current window is scheduled in case the cmdwin is open so this can be too late. "cmdline_hide" may be emitted when the topline is temporarily invalid (after incsearch->restore_viewstate()). Solution: Use the window visibility to determine an active "more" window instead. Don't nvim__redraw->flush the "cmdline_hide" event (a normal will already happen). --- runtime/lua/vim/_extui/cmdline.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/_extui/cmdline.lua') diff --git a/runtime/lua/vim/_extui/cmdline.lua b/runtime/lua/vim/_extui/cmdline.lua index eecd28cde2..b0f660eda3 100644 --- a/runtime/lua/vim/_extui/cmdline.lua +++ b/runtime/lua/vim/_extui/cmdline.lua @@ -99,6 +99,7 @@ function M.cmdline_pos(pos) curpos[1], curpos[2] = M.row + 1, promptlen + pos -- Add matchparen highlighting to non-prompt part of cmdline. if pos > 0 and fn.exists('#matchparen') then + api.nvim_win_set_cursor(ext.wins.cmd, { curpos[1], curpos[2] - 1 }) vim._with({ win = ext.wins.cmd, wo = { eventignorewin = '' } }, function() api.nvim_exec_autocmds('CursorMoved', {}) end) -- cgit v1.3-3-g829e