diff --git a/src/map.c b/src/map.c index 00f4608b07..74fc60c1fc 100644 --- a/src/map.c +++ b/src/map.c @@ -554,7 +554,7 @@ do_map( for ( ; mp != NULL && !got_int; mp = mp->m_next) { // check entries with the same mode - if ((mp->m_mode & mode) != 0) + if (!mp->m_simplified && (mp->m_mode & mode) != 0) { if (!haskey) // show all entries { @@ -599,15 +599,19 @@ do_map( for (mp = *mpp; mp != NULL && !got_int; mp = *mpp) { - if (!(mp->m_mode & mode)) // skip entries with wrong mode + if ((mp->m_mode & mode) == 0) { + // skip entries with wrong mode mpp = &(mp->m_next); continue; } if (!haskey) // show all entries { - showmap(mp, map_table != maphash); - did_it = TRUE; + if (!mp->m_simplified) + { + showmap(mp, map_table != maphash); + did_it = TRUE; + } } else // do we have a match? { @@ -643,8 +647,11 @@ do_map( } else if (!hasarg) // show matching entry { - showmap(mp, map_table != maphash); - did_it = TRUE; + if (!mp->m_simplified) + { + showmap(mp, map_table != maphash); + did_it = TRUE; + } } else if (n != len) // new entry is ambiguous { diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index 93a4d4b857..f62d5755ec 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -442,3 +442,19 @@ func Test_error_in_map_expr() call delete('Xtest.vim') exe buf .. 'bwipe!' endfunc + +func Test_list_mappings() + inoremap CtrlM + inoremap AltS + inoremap ShiftSlash + call assert_equal([ + \ 'i * ShiftSlash', + \ 'i * AltS', + \ 'i * CtrlM', + \], execute('imap')->trim()->split("\n")) + iunmap + iunmap + call assert_equal(['i * ShiftSlash'], execute('imap')->trim()->split("\n")) + iunmap + call assert_equal(['No mapping found'], execute('imap')->trim()->split("\n")) +endfunc diff --git a/src/version.c b/src/version.c index 2042cb0f40..91cffb330d 100644 --- a/src/version.c +++ b/src/version.c @@ -753,6 +753,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2159, /**/ 2158, /**/