Problem: With the key protocol enabled, a mapping for a key with a modifier
is not used when it follows a partial match of another mapping.
Solution: When the modifier was merged into the key in the typeahead, mark
the key, so that the mapping for the simplified key can be used.
fixes: #12002
Typing "a" then CTRL-J in Insert mode inserted "a" and a line break instead
of "ax". The cause was found by @zeertzjq in the issue: while looking for a
mapping starting with "a", the modifier of CTRL-J is merged into the key, and
the mapping for the simplified key is then skipped because the key protocol
is enabled.
That mapping is skipped so a NL typed by the user does not use a mapping for
CTRL-J. The reason does not hold for a key that Vim simplified itself, so
those are now marked in typebuf.tb_noremap[]. The added test also checks
that a real NL still does not use the mapping.
The flag is a new bit in tb_noremap[]. All uses of that array are in
getchar.c; the one place where the value leaves the file, KeyNoremap, masks
the bit out.
https://github.com/vim/vim/pull/20898
(3 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()