Skip to content

Commit

Permalink
patch 9.0.1329: completion of map includes simplified ones
Browse files Browse the repository at this point in the history
Problem:    Completion of map includes simplified ones.
Solution:   Do not complete simplified mappings. (closes #12013)
  • Loading branch information
zeertzjq authored and brammool committed Feb 19, 2023
1 parent 5b9f572 commit 997b8a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/map.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions src/testdir/test_mapping.vim
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1329,
/**/
1328,
/**/
Expand Down

0 comments on commit 997b8a0

Please sign in to comment.