Skip to content

Commit

Permalink
patch 8.0.0274: possible recursive screen updating causes trouble
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
brammool committed Jan 31, 2017
1 parent c4a249a commit 070b33d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,9 @@ update_single_line(win_T *wp, linenr_T lnum)
int j;

/* Don't do anything if the screen structures are (not yet) valid. */
if (!screen_valid(TRUE))
if (!screen_valid(TRUE) || updating_screen)
return;
updating_screen = TRUE;

if (lnum >= wp->w_topline && lnum < wp->w_botline
&& foldedCount(wp, lnum, &win_foldinfo) == 0)
Expand Down Expand Up @@ -865,13 +866,11 @@ update_single_line(win_T *wp, linenr_T lnum)
# endif
}
need_cursor_line_redraw = FALSE;
updating_screen = FALSE;
}
#endif

#if defined(FEAT_SIGNS) || defined(FEAT_GUI)
static void update_prepare(void);
static void update_finish(void);

/*
* Prepare for updating one or more windows.
* Caller must check for "updating_screen" already set to avoid recursiveness.
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
274,
/**/
273,
/**/
Expand Down

0 comments on commit 070b33d

Please sign in to comment.