summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-22 15:19:16 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-22 15:19:16 +0100
commit471c0fa3eed4f6207d1cb7636970547bfd2eee26 (patch)
treea63888422f4a84f9e73b3e23025090127c31fe25 /src/buffer.c
parentf768c3d19c518822d89dec4cc3947ddeea249316 (diff)
patch 9.0.0245: mechanism to prevent recursive screen updating is incompletev9.0.0245
Problem: Mechanism to prevent recursive screen updating is incomplete. Solution: Add "redraw_not_allowed" and set it in build_stl_str_hl(). (issue #10952)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 203238ff78..fba6c218fd 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -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;