From 7bbe8a4900fc2b25784a732ec414b0cfd0c20780 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 12 Dec 2020 09:52:23 -0500 Subject: vim-patch:8.2.2130: Insert mode completion messages end up in message history Problem: Insert mode completion messages end up in message history. Solution: Set msg_hist_off. (closes vim/vim#7452 https://github.com/vim/vim/commit/cc2335896ba707bf0d8cf03cca2de7c66fab62a0 --- src/nvim/edit.c | 13 ++++++++++--- src/nvim/testdir/test_ins_complete.vim | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 7fefa8520a..1cf821f786 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2958,6 +2958,7 @@ static void ins_compl_files(int count, char_u **files, int thesaurus, for (i = 0; i < count && !got_int && !compl_interrupted; i++) { fp = os_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(IObuff, true, HL_ATTR(HLF_R)); @@ -4113,6 +4114,7 @@ static int ins_compl_get_exp(pos_T *ini) 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) @@ -4134,11 +4136,12 @@ static int ins_compl_get_exp(pos_T *ini) dict = e_cpt; dict_f = DICT_FIRST; } - } else if (*e_cpt == 'i') + } else if (*e_cpt == 'i') { type = CTRL_X_PATH_PATTERNS; - else if (*e_cpt == 'd') + } else if (*e_cpt == 'd') { type = CTRL_X_PATH_DEFINES; - else if (*e_cpt == ']' || *e_cpt == 't') { + } 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, "%s", _("Scanning tags.")); (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); @@ -4721,9 +4724,11 @@ ins_compl_next ( 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(IObuff); + msg_hist_off = false; redraw_cmdline = false; // don't overwrite! } } @@ -5333,9 +5338,11 @@ static int ins_complete(int c, bool enable_pum) if (!shortmess(SHM_COMPLETIONMENU)) { if (edit_submode_extra != NULL) { if (!p_smd) { + msg_hist_off = true; msg_attr((const 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" diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index 6fe1d29434..9435931d41 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -280,7 +280,7 @@ func Test_omni_dash() set omnifunc=Omni new exe "normal Gofind -\\" - call assert_equal("\n-\nmatch 1 of 2", execute(':2mess')) + call assert_equal("find -help", getline('$')) bwipe! delfunc Omni @@ -468,3 +468,17 @@ func Test_pum_with_folds_two_tabs() call StopVimInTerminal(buf) call delete('Xpumscript') 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\\" + exe "normal owh\" + call assert_equal(currmess, execute('messages')) + close! +endfunc + +" vim: shiftwidth=2 sts=2 expandtab -- cgit From d5ab4b800c321d6cdd2cb308a9cdbaa3fa66cd8d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 12 Dec 2020 16:23:04 -0500 Subject: vim-patch:8.1.1089: tutor does not check $LC_MESSAGES Problem: Tutor does not check $LC_MESSAGES. Solution: Let $LC_MESSAGES overrule $LANG. (Miklos Vajna, closes vim/vim#4112) https://github.com/vim/vim/commit/b44b7add8ae8e15328b4f68c3caf511bd9aaac8c --- runtime/autoload/tutor.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index 3265fdde36..6afe64de84 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -120,6 +120,12 @@ function! s:Locale() let l:lang = v:lang elseif $LC_ALL =~ '\a\a' let l:lang = $LC_ALL + elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C" + " LC_MESSAGES=C can be used to explicitly ask for English messages while + " keeping LANG non-English; don't set l:lang then. + if $LC_MESSAGES =~ '\a\a' + let l:lang = $LC_MESSAGES + endif elseif $LANG =~ '\a\a' let l:lang = $LANG else -- cgit