From 3601cef1377937f01347b20a8c6c303f5f429f51 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 21:27:58 +0800 Subject: feat(mappings): do not replace existing mapping for simplified form --- src/nvim/getchar.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index a26ca3f2c8..58daa9631a 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3279,6 +3279,11 @@ int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev, buf_T } else if (n != len) { // new entry is ambiguous mpp = &(mp->m_next); continue; + } else if (keyround1_simplified && !mp->m_simplified) { + // In keyround for simplified keys, don't replace + // a mapping without m_simplified flag. + did_it = true; + break; } else if (args->unique) { if (is_abbrev) { semsg(_("E226: abbreviation already exists for %s"), p); -- cgit