0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.0245: mechanism to prevent recursive screen updating is incomplete

Problem:    Mechanism to prevent recursive screen updating is incomplete.
Solution:   Add "redraw_not_allowed" and set it in build_stl_str_hl().
            (issue #10952)
This commit is contained in:
Bram Moolenaar
2022-08-22 15:19:16 +01:00
parent f768c3d19c
commit 471c0fa3ee
13 changed files with 51 additions and 40 deletions

View File

@@ -4228,10 +4228,15 @@ build_stl_str_hl(
char_u win_tmp[TMPLEN];
char_u *usefmt = fmt;
stl_hlrec_T *sp;
int save_must_redraw = must_redraw;
int save_redr_type = curwin->w_redr_type;
int save_redraw_not_allowed = redraw_not_allowed;
int save_KeyTyped = KeyTyped;
// When inside update_screen() we do not want redrawing a statusline,
// ruler, title, etc. to trigger another redraw, it may cause an endless
// loop.
if (updating_screen)
redraw_not_allowed = TRUE;
if (stl_items == NULL)
{
stl_items = ALLOC_MULT(stl_item_T, stl_items_len);
@@ -4968,11 +4973,11 @@ build_stl_str_hl(
else
stl_items[curitem].stl_type = Empty;
if (num >= 0 || (!itemisflag && str != NULL && *str != NUL))
prevchar_isflag = FALSE; // Item not NULL, but not a flag
//
if (opt == STL_VIM_EXPR)
vim_free(str);
if (num >= 0 || (!itemisflag && str && *str))
prevchar_isflag = FALSE; // Item not NULL, but not a flag
curitem++;
}
*p = NUL;
@@ -5125,13 +5130,7 @@ build_stl_str_hl(
sp->userhl = 0;
}
// When inside update_screen we do not want redrawing a statusline, ruler,
// title, etc. to trigger another redraw, it may cause an endless loop.
if (updating_screen)
{
must_redraw = save_must_redraw;
curwin->w_redr_type = save_redr_type;
}
redraw_not_allowed = save_redraw_not_allowed;
// A user function may reset KeyTyped, restore it.
KeyTyped = save_KeyTyped;