Merge pull request #20038 from bfredl/unflush

perf(messages): don't call ui_flush() per message line in various places
This commit is contained in:
bfredl 2022-09-01 10:18:14 +02:00 committed by GitHub
commit d9a873f278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 0 additions and 17 deletions

View File

@ -717,7 +717,6 @@ int showmatches(expand_T *xp, int wildmenu)
msg_clr_eos(); msg_clr_eos();
msg_putchar('\n'); msg_putchar('\n');
} }
ui_flush(); // show one line at a time
if (got_int) { if (got_int) {
got_int = false; got_int = false;
break; break;

View File

@ -650,7 +650,6 @@ void ex_history(exarg_T *eap)
STRCAT(IObuff, hist[i].hisstr); STRCAT(IObuff, hist[i].hisstr);
} }
msg_outtrans((char *)IObuff); msg_outtrans((char *)IObuff);
ui_flush();
} }
if (i == idx) { if (i == idx) {
break; break;

View File

@ -5004,7 +5004,6 @@ void ex_oldfiles(exarg_T *eap)
msg_outtrans((char *)tv_get_string(TV_LIST_ITEM_TV(li))); msg_outtrans((char *)tv_get_string(TV_LIST_ITEM_TV(li)));
msg_clr_eos(); msg_clr_eos();
msg_putchar('\n'); msg_putchar('\n');
ui_flush(); // output one line at a time
os_breakcheck(); os_breakcheck();
} }
}); });

View File

@ -4833,7 +4833,6 @@ static void ex_print(exarg_T *eap)
if (++eap->line1 > eap->line2) { if (++eap->line1 > eap->line2) {
break; break;
} }
ui_flush(); // show one line at a time
} }
setpcmark(); setpcmark();
// put cursor at last line // put cursor at last line
@ -5035,7 +5034,6 @@ static void ex_tabs(exarg_T *eap)
msg_putchar('\n'); msg_putchar('\n');
vim_snprintf((char *)IObuff, IOSIZE, _("Tab page %d"), tabcount++); vim_snprintf((char *)IObuff, IOSIZE, _("Tab page %d"), tabcount++);
msg_outtrans_attr((char *)IObuff, HL_ATTR(HLF_T)); msg_outtrans_attr((char *)IObuff, HL_ATTR(HLF_T));
ui_flush(); // output one line at a time
os_breakcheck(); os_breakcheck();
FOR_ALL_WINDOWS_IN_TAB(wp, tp) { FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
@ -5054,7 +5052,6 @@ static void ex_tabs(exarg_T *eap)
home_replace(wp->w_buffer, wp->w_buffer->b_fname, (char *)IObuff, IOSIZE, true); home_replace(wp->w_buffer, wp->w_buffer->b_fname, (char *)IObuff, IOSIZE, true);
} }
msg_outtrans((char *)IObuff); msg_outtrans((char *)IObuff);
ui_flush(); // output one line at a time
os_breakcheck(); os_breakcheck();
} }
} }

View File

@ -214,7 +214,6 @@ static void showmap(mapblock_T *mp, bool local)
last_set_msg(mp->m_script_ctx); last_set_msg(mp->m_script_ctx);
} }
msg_clr_eos(); msg_clr_eos();
ui_flush(); // show one line at a time
} }
/// Replace termcodes in the given LHS and RHS and store the results into the /// Replace termcodes in the given LHS and RHS and store the results into the

View File

@ -925,7 +925,6 @@ static void show_one_mark(int c, char_u *arg, pos_T *p, char_u *name_arg, int cu
msg_outtrans_attr((char *)name, current ? HL_ATTR(HLF_D) : 0); msg_outtrans_attr((char *)name, current ? HL_ATTR(HLF_D) : 0);
} }
} }
ui_flush(); // show one line at a time
} }
if (mustfree) { if (mustfree) {
xfree(name); xfree(name);
@ -1058,7 +1057,6 @@ void ex_jumps(exarg_T *eap)
xfree(name); xfree(name);
os_breakcheck(); os_breakcheck();
} }
ui_flush();
} }
if (curwin->w_jumplistidx == curwin->w_jumplistlen) { if (curwin->w_jumplistidx == curwin->w_jumplistlen) {
msg_puts("\n>"); msg_puts("\n>");
@ -1101,7 +1099,6 @@ void ex_changes(exarg_T *eap)
xfree(name); xfree(name);
os_breakcheck(); os_breakcheck();
} }
ui_flush();
} }
if (curwin->w_changelistidx == curbuf->b_changelistlen) { if (curwin->w_changelistidx == curbuf->b_changelistlen) {
msg_puts("\n>"); msg_puts("\n>");

View File

@ -3866,7 +3866,6 @@ void ex_display(exarg_T *eap)
if (n > 1 && yb->y_type == kMTLineWise) { if (n > 1 && yb->y_type == kMTLineWise) {
msg_puts_attr("^J", attr); msg_puts_attr("^J", attr);
} }
ui_flush(); // show one line at a time
} }
os_breakcheck(); os_breakcheck();
} }

View File

@ -3355,7 +3355,6 @@ static void showoptions(int all, int opt_flags)
showoneopt(items[i], opt_flags); showoneopt(items[i], opt_flags);
col += INC; col += INC;
} }
ui_flush();
os_breakcheck(); os_breakcheck();
} }
} }

View File

@ -3094,8 +3094,6 @@ static void qf_list_entry(qfline_T *qfp, int qf_idx, bool cursel)
if (tbuf != IObuff) { if (tbuf != IObuff) {
xfree(tbuf); xfree(tbuf);
} }
ui_flush(); // show one line at a time
} }
// ":clist": list all errors // ":clist": list all errors

View File

@ -3714,7 +3714,6 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
} }
} }
} }
ui_flush(); // output each line directly
} }
if (new_fname != NULL) { if (new_fname != NULL) {
@ -4147,7 +4146,6 @@ static void show_pat_in_path(char_u *line, int type, bool did_show, int action,
msg_puts(" "); msg_puts(" ");
} }
msg_prt_line((char *)line, false); msg_prt_line((char *)line, false);
ui_flush(); // show one line at a time
// Definition continues until line that doesn't end with '\' // Definition continues until line that doesn't end with '\'
if (got_int || type != FIND_DEFINE || p < line || *p != '\\') { if (got_int || type != FIND_DEFINE || p < line || *p != '\\') {

View File

@ -1056,7 +1056,6 @@ void do_tags(exarg_T *eap)
? HL_ATTR(HLF_D) : 0); ? HL_ATTR(HLF_D) : 0);
xfree(name); xfree(name);
} }
ui_flush(); // show one line at a time
} }
if (tagstackidx == tagstacklen) { // idx at top of stack if (tagstackidx == tagstacklen) { // idx at top of stack
msg_puts("\n>"); msg_puts("\n>");