vim-patch:8.2.4504: when there is a partially matching map full map may not work

Problem:    When there is a partially matching map and modifyOtherKeys is
            active a full map may not work.
Solution:   Only simplify modifiers when there is no matching mapping.
            (closes vim/vim#8792)
196c3850db

Omit test as it sends terminal codes. Use a Lua test instead.
This commit is contained in:
zeertzjq
2022-04-27 16:54:59 +08:00
parent 096923e990
commit 04a437b280
2 changed files with 13 additions and 2 deletions

View File

@@ -1972,7 +1972,7 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
}
// If no partly match found, use the longest full match.
if (keylen != KEYLEN_PART_MAP) {
if (keylen != KEYLEN_PART_MAP && mp_match != NULL) {
mp = mp_match;
keylen = mp_match_len;
}
@@ -2011,7 +2011,7 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
}
}
if ((mp == NULL || max_mlen >= mp_match_len) && keylen != KEYLEN_PART_MAP) {
if ((mp == NULL || max_mlen > mp_match_len) && keylen != KEYLEN_PART_MAP) {
// When no matching mapping found or found a non-matching mapping that
// matches at least what the matching mapping matched:
// Try to include the modifier into the key, when: