Patch 8.1.2159
Problem:    Some mappings are listed twice.
Solution:   Skip mappings duplicated for modifyOtherKeys. (closes #5064)
Files:      src/map.c, src/testdir/test_mapping.vim


*** ../vim-8.1.2158/src/map.c   2019-10-13 16:43:35.956359658 +0200
--- src/map.c   2019-10-16 18:33:32.048647070 +0200
***************
*** 554,560 ****
                for ( ; mp != NULL && !got_int; mp = mp->m_next)
                {
                    // check entries with the same mode
!                   if ((mp->m_mode & mode) != 0)
                    {
                        if (!haskey)                // show all entries
                        {
--- 554,560 ----
                for ( ; mp != NULL && !got_int; mp = mp->m_next)
                {
                    // check entries with the same mode
!                   if (!mp->m_simplified && (mp->m_mode & mode) != 0)
                    {
                        if (!haskey)                // show all entries
                        {
***************
*** 599,613 ****
                for (mp = *mpp; mp != NULL && !got_int; mp = *mpp)
                {
  
!                   if (!(mp->m_mode & mode))   // skip entries with wrong mode
                    {
                        mpp = &(mp->m_next);
                        continue;
                    }
                    if (!haskey)        // show all entries
                    {
!                       showmap(mp, map_table != maphash);
!                       did_it = TRUE;
                    }
                    else        // do we have a match?
                    {
--- 599,617 ----
                for (mp = *mpp; mp != NULL && !got_int; mp = *mpp)
                {
  
!                   if ((mp->m_mode & mode) == 0)
                    {
+                       // skip entries with wrong mode
                        mpp = &(mp->m_next);
                        continue;
                    }
                    if (!haskey)        // show all entries
                    {
!                       if (!mp->m_simplified)
!                       {
!                           showmap(mp, map_table != maphash);
!                           did_it = TRUE;
!                       }
                    }
                    else        // do we have a match?
                    {
***************
*** 643,650 ****
                            }
                            else if (!hasarg)   // show matching entry
                            {
!                               showmap(mp, map_table != maphash);
!                               did_it = TRUE;
                            }
                            else if (n != len)  // new entry is ambiguous
                            {
--- 647,657 ----
                            }
                            else if (!hasarg)   // show matching entry
                            {
!                               if (!mp->m_simplified)
!                               {
!                                   showmap(mp, map_table != maphash);
!                                   did_it = TRUE;
!                               }
                            }
                            else if (n != len)  // new entry is ambiguous
                            {
*** ../vim-8.1.2158/src/testdir/test_mapping.vim        2019-08-16 
21:47:23.870692859 +0200
--- src/testdir/test_mapping.vim        2019-10-16 18:31:30.809166905 +0200
***************
*** 442,444 ****
--- 442,460 ----
    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
*** ../vim-8.1.2158/src/version.c       2019-10-16 18:11:13.706363954 +0200
--- src/version.c       2019-10-16 18:23:02.095346287 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     2159,
  /**/

-- 
   Another bucket of what can only be described as human ordure hits ARTHUR.
ARTHUR: ... Right!  (to the KNIGHTS) That settles it!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201910161637.x9GGbCDb032296%40masaka.moolenaar.net.

Raspunde prin e-mail lui