diff --git a/runtime/lua/vim/_core/ui2/messages.lua b/runtime/lua/vim/_core/ui2/messages.lua index 2de4501193..8c06133e16 100644 --- a/runtime/lua/vim/_core/ui2/messages.lua +++ b/runtime/lua/vim/_core/ui2/messages.lua @@ -598,6 +598,7 @@ end local typed_g = false local function cmd_on_key(key, typed) + typed = fn.keytrans(typed) -- Don't dismiss for non-typed keys and mouse movement. When 'g' is passed (typed -- or mapped), wait until the next key to avoid flickering when the pager is opened. if not typed_g and (typed == '' or (typed == '' or typed == 'g' or key == 'g')) then @@ -611,7 +612,6 @@ local function cmd_on_key(key, typed) return end vim.on_key(nil, ui.ns) - typed = fn.keytrans(typed) -- Check if window was entered and reopen with original config. A shown (but not entered) -- pager is dismissed instead; "g<" passes through to reopen and enter it. diff --git a/test/functional/ui/messages2_spec.lua b/test/functional/ui/messages2_spec.lua index 49b723dcfd..f1d8ed9fde 100644 --- a/test/functional/ui/messages2_spec.lua +++ b/test/functional/ui/messages2_spec.lua @@ -544,6 +544,8 @@ describe('messages2', function() baz | {16::}{15:echo} {26:"baz"} | ]]) + -- Moving the mouse does not dismiss the pager. + api.nvim_input_mouse('move', '', '', 0, 0, 3) -- Subsequent typed commands are appended to the pager. feed(':echo "typed append"') screen:expect([[