refactor: remove 'shortmess' save/restore panic for ex commands

This was only used to avoid the effect of SHM_OVERALL. This can easily
be handled in isolation, instead of clearing out all of 'shortmess' which
has unwanted side effects and mystifies what really is going on.
This commit is contained in:
bfredl
2023-09-25 12:26:01 +02:00
parent ccd1a84a96
commit 68d425ac92
6 changed files with 12 additions and 48 deletions

View File

@@ -455,6 +455,10 @@ void ex_listdo(exarg_T *eap)
tabpage_T *tp;
char *save_ei = NULL;
// Temporarily override SHM_OVER and SHM_OVERALL to avoid that file
// message overwrites output from the command.
msg_listdo_overwrite++;
if (eap->cmdidx != CMD_windo && eap->cmdidx != CMD_tabdo) {
// Don't do syntax HL autocommands. Skipping the syntax file is a
// great speed improvement.
@@ -518,9 +522,7 @@ void ex_listdo(exarg_T *eap)
if (qf_size == 0 || (size_t)eap->line1 > qf_size) {
buf = NULL;
} else {
save_clear_shm_value();
ex_cc(eap);
restore_shm_value();
buf = curbuf;
i = (int)eap->line1 - 1;
@@ -547,9 +549,7 @@ void ex_listdo(exarg_T *eap)
if (curwin->w_arg_idx != i || !editing_arg_idx(curwin)) {
// Clear 'shm' to avoid that the file message overwrites
// any output from the command.
save_clear_shm_value();
do_argfile(eap, i);
restore_shm_value();
}
if (curwin->w_arg_idx != i) {
break;
@@ -612,11 +612,8 @@ void ex_listdo(exarg_T *eap)
break;
}
// Go to the next buffer. Clear 'shm' to avoid that the file
// message overwrites any output from the command.
save_clear_shm_value();
// Go to the next buffer.
goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum);
restore_shm_value();
// If autocommands took us elsewhere, quit here.
if (curbuf->b_fnum != next_fnum) {
@@ -633,11 +630,7 @@ void ex_listdo(exarg_T *eap)
size_t qf_idx = qf_get_cur_idx(eap);
// Clear 'shm' to avoid that the file message overwrites
// any output from the command.
save_clear_shm_value();
ex_cnext(eap);
restore_shm_value();
// If jumping to the next quickfix entry fails, quit here.
if (qf_get_cur_idx(eap) == qf_idx) {
@@ -664,6 +657,7 @@ void ex_listdo(exarg_T *eap)
listcmd_busy = false;
}
msg_listdo_overwrite--;
if (save_ei != NULL) {
buf_T *bnext;
aco_save_T aco;