Patch 8.2.2130
Problem:    Insert mode completion messages end up in message history.
Solution:   Set msg_hist_off. (closes #7452
Files:      src/insexpand.c, src/testdir/test_ins_complete.vim


*** ../vim-8.2.2129/src/insexpand.c     2020-11-12 14:20:32.021927293 +0100
--- src/insexpand.c     2020-12-12 13:12:02.544533489 +0100
***************
*** 1298,1303 ****
--- 1298,1304 ----
        fp = mch_fopen((char *)files[i], "r");  // open dictionary file
        if (flags != DICT_EXACT)
        {
+           msg_hist_off = TRUE;        // reset in msg_trunc_attr()
            vim_snprintf((char *)IObuff, IOSIZE,
                              _("Scanning dictionary: %s"), (char *)files[i]);
            (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
***************
*** 2778,2783 ****
--- 2779,2785 ----
                    dict = ins_buf->b_fname;
                    dict_f = DICT_EXACT;
                }
+               msg_hist_off = TRUE;    // reset in msg_trunc_attr()
                vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"),
                        ins_buf->b_fname == NULL
                            ? buf_spname(ins_buf)
***************
*** 2812,2817 ****
--- 2814,2820 ----
  #endif
                else if (*e_cpt == ']' || *e_cpt == 't')
                {
+                   msg_hist_off = TRUE;        // reset in msg_trunc_attr()
                    type = CTRL_X_TAGS;
                    vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
                    (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
***************
*** 3423,3431 ****
--- 3426,3436 ----
                    MB_PTR_ADV(s);
                }
            }
+           msg_hist_off = TRUE;
            vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
                                s > compl_shown_match->cp_fname ? "<" : "", s);
            msg((char *)IObuff);
+           msg_hist_off = FALSE;
            redraw_cmdline = FALSE;         // don't overwrite!
        }
      }
***************
*** 4105,4113 ****
--- 4110,4122 ----
            if (edit_submode_extra != NULL)
            {
                if (!p_smd)
+               {
+                   msg_hist_off = TRUE;
                    msg_attr((char *)edit_submode_extra,
                            edit_submode_highl < HLF_COUNT
                            ? HL_ATTR(edit_submode_highl) : 0);
+                   msg_hist_off = FALSE;
+               }
            }
            else
                msg_clr_cmdline();      // necessary for "noshowmode"
*** ../vim-8.2.2129/src/testdir/test_ins_complete.vim   2020-10-26 
19:22:35.513731793 +0100
--- src/testdir/test_ins_complete.vim   2020-12-12 13:09:25.972778618 +0100
***************
*** 114,120 ****
    set omnifunc=Omni
    new
    exe "normal Gofind -\<C-x>\<C-o>"
!   call assert_equal("\n-\nmatch 1 of 2", execute(':2mess'))
  
    bwipe!
    delfunc Omni
--- 114,120 ----
    set omnifunc=Omni
    new
    exe "normal Gofind -\<C-x>\<C-o>"
!   call assert_equal("find -help", getline('$'))
  
    bwipe!
    delfunc Omni
***************
*** 714,717 ****
--- 714,729 ----
    set completeslash=
  endfunc
  
+ " Test to ensure 'Scanning...' messages are not recorded in messages history
+ func Test_z1_complete_no_history()
+   new
+   messages clear
+   let currmess = execute('messages')
+   setlocal dictionary=README.txt
+   exe "normal owh\<C-X>\<C-K>"
+   exe "normal owh\<C-N>"
+   call assert_equal(currmess, execute('messages'))
+   close!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2129/src/version.c       2020-12-11 20:10:46.553894148 +0100
--- src/version.c       2020-12-12 13:30:48.697615308 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2130,
  /**/

-- 
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
                  KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
                  HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
                  LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
                  BROTHER MAYNARD
                 "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/202012121232.0BCCWauf2773903%40masaka.moolenaar.net.

Raspunde prin e-mail lui