]> granicus.if.org Git - vim/commitdiff
patch 9.0.1329: completion of map includes simplified ones v9.0.1329
authorzeertzjq <zeertzjq@outlook.com>
Sun, 19 Feb 2023 21:00:31 +0000 (21:00 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Feb 2023 21:00:31 +0000 (21:00 +0000)
Problem:    Completion of map includes simplified ones.
Solution:   Do not complete simplified mappings. (closes #12013)

src/map.c
src/testdir/test_mapping.vim
src/version.c

index 9be67cd74bd123e80cdca201a3cab36563f643e1..9a6cdb143cc2f96db8f6855b290e1a0918ec8aa9 100644 (file)
--- 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);
index 0390d4f1b09d181b72050be20ff9865bdc001af4..d631274d3735529a8a0d1b72cc1512beca1b95c4 100644 (file)
@@ -783,11 +783,12 @@ func Test_mapcomplete()
   call feedkeys(":abbr! \<C-A>\<C-B>\"\<CR>", 'tx')
   call assert_equal("\"abbr! \x01", @:)
 
-  " Multiple matches for a map
-  nmap ,f /H<CR>
-  omap ,f /H<CR>
+  " When multiple matches have the same {lhs}, it should only appear once.
+  " The simplified form should also not be included.
+  nmap ,<C-F> /H<CR>
+  omap ,<C-F> /H<CR>
   call feedkeys(":map ,\<C-A>\<C-B>\"\<CR>", 'tx')
-  call assert_equal('"map ,f', @:)
+  call assert_equal('"map ,<C-F>', @:)
   mapclear
 endfunc
 
index 41726ea3e4986bcc00ed39eef752f9cd8c3d4f3a..d219f0fae589be8b32b59212d2869f5ff03dc85e 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1329,
 /**/
     1328,
 /**/