Skip to content

Commit 070b33d

Browse files
committed
patch 8.0.0274: possible recursive screen updating causes trouble
Problem: When update_single_line() is called recursively, or another screen update happens while it is busy, errors may occur. Solution: Check and update updating_screen. (Christian Brabandt)
1 parent c4a249a commit 070b33d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/screen.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,9 @@ update_single_line(win_T *wp, linenr_T lnum)
824824
int j;
825825

826826
/* Don't do anything if the screen structures are (not yet) valid. */
827-
if (!screen_valid(TRUE))
827+
if (!screen_valid(TRUE) || updating_screen)
828828
return;
829+
updating_screen = TRUE;
829830

830831
if (lnum >= wp->w_topline && lnum < wp->w_botline
831832
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
@@ -865,13 +866,11 @@ update_single_line(win_T *wp, linenr_T lnum)
865866
# endif
866867
}
867868
need_cursor_line_redraw = FALSE;
869+
updating_screen = FALSE;
868870
}
869871
#endif
870872

871873
#if defined(FEAT_SIGNS) || defined(FEAT_GUI)
872-
static void update_prepare(void);
873-
static void update_finish(void);
874-
875874
/*
876875
* Prepare for updating one or more windows.
877876
* Caller must check for "updating_screen" already set to avoid recursiveness.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
274,
767769
/**/
768770
273,
769771
/**/

0 commit comments

Comments
 (0)