From 7dc0592fca3190a9f6ce4d83e8af33d88c5d33e7 Mon Sep 17 00:00:00 2001 From: not_compiled Date: Mon, 31 Aug 2026 04:03:59 +0530 Subject: [PATCH] fix(ui2): cursor flicker in cmdline with matchit #41245 Problem: The cmdline_hide callback causes an unnecessary cursor move to the cmdline, before the normal redraw updates the cursor back to the current window. This appears as "flicker" when using plugins such as matchit (legacy ":" mappings instead of "" mappings). Solution: Skip the immediate redraw for cmdline_hide events. The normal redraw still updates the cursor after the cmdline window is hidden. --- runtime/lua/vim/_core/ui2.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/_core/ui2.lua b/runtime/lua/vim/_core/ui2.lua index 7c6d1359bd..8e8459f2f3 100644 --- a/runtime/lua/vim/_core/ui2.lua +++ b/runtime/lua/vim/_core/ui2.lua @@ -157,7 +157,10 @@ local function ui_callback(redraw_msg, event, ...) M.check_targets() handler(...) -- Cmdline mode, non-fast message and non-empty showcmd require an immediate redraw. - if M.cmd[event] or redraw_msg or (event == 'msg_showcmd' and select(1, ...)[1]) then + if + (M.cmd[event] or redraw_msg or (event == 'msg_showcmd' and select(1, ...)[1])) + and event ~= 'cmdline_hide' + then M.redrawing = true api.nvim__redraw({ flush = handler ~= M.cmd.cmdline_hide or nil,