0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 9.0.1064: code for making 'shortmess' temporarily empty is repeated

Problem:    Code for making 'shortmess' temporarily empty is repeated.
Solution:   Add functions for making 'shortmess' empty and restoring it.
            (Christian Brabandt, closes #11709)
This commit is contained in:
Christian Brabandt
2022-12-16 16:41:23 +00:00
committed by Bram Moolenaar
parent 4ab1f4a32f
commit 9aee8ec400
7 changed files with 111 additions and 17 deletions

View File

@@ -460,7 +460,6 @@ ex_listdo(exarg_T *eap)
#if defined(FEAT_SYN_HL)
char_u *save_ei = NULL;
#endif
char_u *p_shm_save;
#ifdef FEAT_QUICKFIX
int qf_size = 0;
int qf_idx;
@@ -541,7 +540,9 @@ ex_listdo(exarg_T *eap)
buf = NULL;
else
{
save_clear_shm_value();
ex_cc(eap);
restore_shm_value();
buf = curbuf;
i = eap->line1 - 1;
@@ -568,13 +569,9 @@ ex_listdo(exarg_T *eap)
{
// Clear 'shm' to avoid that the file message overwrites
// any output from the command.
p_shm_save = vim_strsave(p_shm);
set_option_value_give_err((char_u *)"shm",
0L, (char_u *)"", 0);
save_clear_shm_value();
do_argfile(eap, i);
set_option_value_give_err((char_u *)"shm",
0L, p_shm_save, 0);
vim_free(p_shm_save);
restore_shm_value();
}
if (curwin->w_arg_idx != i)
break;
@@ -630,11 +627,9 @@ ex_listdo(exarg_T *eap)
// Go to the next buffer. Clear 'shm' to avoid that the file
// message overwrites any output from the command.
p_shm_save = vim_strsave(p_shm);
set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0);
save_clear_shm_value();
goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum);
set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0);
vim_free(p_shm_save);
restore_shm_value();
// If autocommands took us elsewhere, quit here.
if (curbuf->b_fnum != next_fnum)
@@ -650,13 +645,9 @@ ex_listdo(exarg_T *eap)
qf_idx = qf_get_cur_idx(eap);
// Clear 'shm' to avoid that the file message overwrites
// any output from the command.
p_shm_save = vim_strsave(p_shm);
set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0);
save_clear_shm_value();
ex_cnext(eap);
set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0);
vim_free(p_shm_save);
restore_shm_value();
// If jumping to the next quickfix entry fails, quit here
if (qf_get_cur_idx(eap) == qf_idx)