From 196c3850dbe95247f7aa1b0000a5cae625a99ef2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 4 Mar 2022 19:22:36 +0000 Subject: 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 #8792) --- src/getchar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/getchar.c') diff --git a/src/getchar.c b/src/getchar.c index 2fbbd4f6e1..03d6d4d96d 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -2598,7 +2598,7 @@ handle_mapping( } // 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; @@ -2643,7 +2643,7 @@ handle_mapping( max_mlen = mlen + 1; } - if ((mp == NULL || max_mlen >= mp_match_len) && keylen != KEYLEN_PART_MAP) + if ((mp == NULL || max_mlen > mp_match_len) && keylen != KEYLEN_PART_MAP) { int save_keylen = keylen; -- cgit v1.2.3