mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 09:31:47 +00:00
fix(ui2): dismiss msgs after mapped motions #41450
Problem: Mapped keys can produce on_key callbacks with an empty `typed` value. so mapped motions such as `j -> gj` are not recognized as typed input and do not dismiss messages Solution: Track whether an empty `typed` callback follows typed input, allowing mapped motions to dismiss messages like directly typed motions.
This commit is contained in:
@@ -582,8 +582,8 @@ local typed_g = false
|
||||
local function cmd_on_key(key, 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 typed == '' or (not typed_g and (typed == '<MouseMove>' or typed == 'g' or key == 'g')) then
|
||||
typed_g = typed == 'g' or key == 'g'
|
||||
if not typed_g and (typed == '' or (typed == '<MouseMove>' or typed == 'g' or key == 'g')) then
|
||||
typed_g = typed ~= '' and (typed == 'g' or key == 'g')
|
||||
return
|
||||
end
|
||||
if typed == ':' or ui.cmd.level > 0 or fn.getcmdtype() ~= '' then
|
||||
|
||||
Reference in New Issue
Block a user