[vim/vim] Recognize modifiers in mappings (PR #19643)

1 view
Skip to first unread message

erry

unread,
Mar 11, 2026, 8:43:59 PM (16 hours ago) Mar 11
to vim/vim, Subscribed

Suggested fix for #19182. This patch does not solve failing case 2, because replace_termcodes handles replacing ^[OA with the builtin code for Up and replacing <Esc> with the escape character all in the same operation, and I couldn't find a simple way to reliably compose them. This code comment seems misleading, as vim doesn't appear to check key codes after replacing special <...> key codes. Perhaps it did at some point in the past. As a result, I consider that a separate issue and did not check for it in the test that I added.

Some of the code that I added is lifted from check_termcode, which also handles modifiers. If this is considered repetitive, I'm happy to try to refactor the code that is common between them.

Additionally, this fix activates a bug in got_code_from_term as I explained in a previous issue. Now that find_term_bykeys understands modifiers, got_code_from_term is more effective at removing duplicate key codes from the termcodes table, and will remove editing pad keys in favour of keypad keys because keypad keys are received later. This new issue is fixed by [placeholder].


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19643

Commit Summary

  • 22e5ad7 Recognize modifiers in mappings

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19643@github.com>

Reply all
Reply to author
Forward
0 new messages