aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/getchar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 458c79ad4e..d1a28ae3b0 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1844,8 +1844,11 @@ static int vgetorpeek(int advance)
keylen = KEYLEN_PART_MAP;
break;
}
- } else if (keylen > mp_match_len) {
- /* found a longer match */
+ } else if (keylen > mp_match_len
+ || (keylen == mp_match_len
+ && (mp_match->m_mode & LANGMAP) == 0
+ && (mp->m_mode & LANGMAP) != 0)) {
+ // found a longer match
mp_match = mp;
mp_match_len = keylen;
}