From 997b8a015cd39141866e953651d55c705275cbd6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 19 Feb 2023 21:00:31 +0000 Subject: patch 9.0.1329: completion of map includes simplified ones Problem: Completion of map includes simplified ones. Solution: Do not complete simplified mappings. (closes #12013) --- src/map.c | 4 ++-- src/testdir/test_mapping.vim | 9 +++++---- src/version.c | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/map.c b/src/map.c index 9be67cd74b..9a6cdb143c 100644 --- a/src/map.c +++ b/src/map.c @@ -180,7 +180,7 @@ showmap( len = msg_outtrans_special(mp->m_keys, TRUE, 0); do { - msg_putchar(' '); // padd with blanks + msg_putchar(' '); // pad with blanks ++len; } while (len < 12); @@ -1445,7 +1445,7 @@ ExpandMappings( mp = maphash[hash]; for (; mp; mp = mp->m_next) { - if (!(mp->m_mode & expand_mapmodes)) + if (mp->m_simplified || !(mp->m_mode & expand_mapmodes)) continue; p = translate_mapping(mp->m_keys); diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 0390d4f1b0..d631274d37 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -783,11 +783,12 @@ func Test_mapcomplete() call feedkeys(":abbr! \\\"\", 'tx') call assert_equal("\"abbr! \x01", @:) - " Multiple matches for a map - nmap ,f /H - omap ,f /H + " When multiple matches have the same {lhs}, it should only appear once. + " The simplified form should also not be included. + nmap , /H + omap , /H call feedkeys(":map ,\\\"\", 'tx') - call assert_equal('"map ,f', @:) + call assert_equal('"map ,', @:) mapclear endfunc diff --git a/src/version.c b/src/version.c index 41726ea3e4..d219f0fae5 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1329, /**/ 1328, /**/ -- cgit v1.2.3