comparison src/insexpand.c @ 23169:5e6855ebc4ea v8.2.2130

patch 8.2.2130: Insert mode completion messages end up in message history Commit: https://github.com/vim/vim/commit/cc2335896ba707bf0d8cf03cca2de7c66fab62a0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 12 13:32:07 2020 +0100 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 https://github.com/vim/vim/issues/7452
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Dec 2020 13:45:04 +0100
parents 6d50182e7e24
children b545334ae654
comparison
equal deleted inserted replaced
23168:56ca83d325b5 23169:5e6855ebc4ea
1296 for (i = 0; i < count && !got_int && !compl_interrupted; i++) 1296 for (i = 0; i < count && !got_int && !compl_interrupted; i++)
1297 { 1297 {
1298 fp = mch_fopen((char *)files[i], "r"); // open dictionary file 1298 fp = mch_fopen((char *)files[i], "r"); // open dictionary file
1299 if (flags != DICT_EXACT) 1299 if (flags != DICT_EXACT)
1300 { 1300 {
1301 msg_hist_off = TRUE; // reset in msg_trunc_attr()
1301 vim_snprintf((char *)IObuff, IOSIZE, 1302 vim_snprintf((char *)IObuff, IOSIZE,
1302 _("Scanning dictionary: %s"), (char *)files[i]); 1303 _("Scanning dictionary: %s"), (char *)files[i]);
1303 (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R)); 1304 (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
1304 } 1305 }
1305 1306
2776 continue; 2777 continue;
2777 type = CTRL_X_DICTIONARY; 2778 type = CTRL_X_DICTIONARY;
2778 dict = ins_buf->b_fname; 2779 dict = ins_buf->b_fname;
2779 dict_f = DICT_EXACT; 2780 dict_f = DICT_EXACT;
2780 } 2781 }
2782 msg_hist_off = TRUE; // reset in msg_trunc_attr()
2781 vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"), 2783 vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"),
2782 ins_buf->b_fname == NULL 2784 ins_buf->b_fname == NULL
2783 ? buf_spname(ins_buf) 2785 ? buf_spname(ins_buf)
2784 : ins_buf->b_sfname == NULL 2786 : ins_buf->b_sfname == NULL
2785 ? ins_buf->b_fname 2787 ? ins_buf->b_fname
2810 else if (*e_cpt == 'd') 2812 else if (*e_cpt == 'd')
2811 type = CTRL_X_PATH_DEFINES; 2813 type = CTRL_X_PATH_DEFINES;
2812 #endif 2814 #endif
2813 else if (*e_cpt == ']' || *e_cpt == 't') 2815 else if (*e_cpt == ']' || *e_cpt == 't')
2814 { 2816 {
2817 msg_hist_off = TRUE; // reset in msg_trunc_attr()
2815 type = CTRL_X_TAGS; 2818 type = CTRL_X_TAGS;
2816 vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags.")); 2819 vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
2817 (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R)); 2820 (void)msg_trunc_attr((char *)IObuff, TRUE, HL_ATTR(HLF_R));
2818 } 2821 }
2819 else 2822 else
3421 { 3424 {
3422 space += ptr2cells(s); 3425 space += ptr2cells(s);
3423 MB_PTR_ADV(s); 3426 MB_PTR_ADV(s);
3424 } 3427 }
3425 } 3428 }
3429 msg_hist_off = TRUE;
3426 vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead, 3430 vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
3427 s > compl_shown_match->cp_fname ? "<" : "", s); 3431 s > compl_shown_match->cp_fname ? "<" : "", s);
3428 msg((char *)IObuff); 3432 msg((char *)IObuff);
3433 msg_hist_off = FALSE;
3429 redraw_cmdline = FALSE; // don't overwrite! 3434 redraw_cmdline = FALSE; // don't overwrite!
3430 } 3435 }
3431 } 3436 }
3432 3437
3433 return num_matches; 3438 return num_matches;
4103 if (!shortmess(SHM_COMPLETIONMENU)) 4108 if (!shortmess(SHM_COMPLETIONMENU))
4104 { 4109 {
4105 if (edit_submode_extra != NULL) 4110 if (edit_submode_extra != NULL)
4106 { 4111 {
4107 if (!p_smd) 4112 if (!p_smd)
4113 {
4114 msg_hist_off = TRUE;
4108 msg_attr((char *)edit_submode_extra, 4115 msg_attr((char *)edit_submode_extra,
4109 edit_submode_highl < HLF_COUNT 4116 edit_submode_highl < HLF_COUNT
4110 ? HL_ATTR(edit_submode_highl) : 0); 4117 ? HL_ATTR(edit_submode_highl) : 0);
4118 msg_hist_off = FALSE;
4119 }
4111 } 4120 }
4112 else 4121 else
4113 msg_clr_cmdline(); // necessary for "noshowmode" 4122 msg_clr_cmdline(); // necessary for "noshowmode"
4114 } 4123 }
4115 } 4124 }