diff src/getchar.c @ 27958:ac7db4437368 v8.2.4504

patch 8.2.4504: when there is a partially matching map full map may not work Commit: https://github.com/vim/vim/commit/196c3850dbe95247f7aa1b0000a5cae625a99ef2 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 4 19:22:36 2022 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Fri, 04 Mar 2022 20:30:03 +0100
parents 3de9be15de51
children f615d89a5351
line wrap: on
line diff
--- 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;