aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-27 16:54:59 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-04-29 15:51:04 +0800
commit04a437b280b13bd33c37e99c46403198126d5343 (patch)
tree93fd9f8d10e43d309c31655614d3c6927dda535b /src
parent096923e99067ba81d1f8f6bc5927920a1f5cceee (diff)
downloadrneovim-04a437b280b13bd33c37e99c46403198126d5343.tar.gz
rneovim-04a437b280b13bd33c37e99c46403198126d5343.tar.bz2
rneovim-04a437b280b13bd33c37e99c46403198126d5343.zip
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) https://github.com/vim/vim/commit/196c3850dbe95247f7aa1b0000a5cae625a99ef2 Omit test as it sends terminal codes. Use a Lua test instead.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/getchar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 42044f6378..555eadb5d4 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -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: