Ensure :lmap mappings take preference

If the mental model of :lmap mappings is a translation between your
keyboard and vim proper, then they should take preference over :imap
(and other) mappings. This patch makes that happen.
This commit is contained in:
Matthew Malcomson
2017-04-04 14:28:20 +01:00
parent 8e71a26e19
commit 9beaf84d2f

View File

@@ -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;
}