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
{
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?
{
}
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
{
call delete('Xtest.vim')
exe buf .. 'bwipe!'
endfunc
+
+func Test_list_mappings()
+ inoremap <C-M> CtrlM
+ inoremap <A-S> AltS
+ inoremap <S-/> ShiftSlash
+ call assert_equal([
+ \ 'i <S-/> * ShiftSlash',
+ \ 'i <M-S> * AltS',
+ \ 'i <C-M> * CtrlM',
+ \], execute('imap')->trim()->split("\n"))
+ iunmap <C-M>
+ iunmap <A-S>
+ call assert_equal(['i <S-/> * ShiftSlash'], execute('imap')->trim()->split("\n"))
+ iunmap <S-/>
+ call assert_equal(['No mapping found'], execute('imap')->trim()->split("\n"))
+endfunc