Skip to content

Commit 072412e

Browse files
committed
patch 8.0.1100: stuck in redraw loop when 'lazyredraw' is set
Problem: Stuck in redraw loop when 'lazyredraw' is set. Solution: Don't loop on update_screen() when not redrawing. (Yasuhiro Matsumoto, closes #2082)
1 parent 518d699 commit 072412e

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/proto/screen.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int redraw_asap(int type);
1010
void redraw_after_callback(int call_update_screen);
1111
void redrawWinline(linenr_T lnum, int invalid);
1212
void update_curbuf(int type);
13-
void update_screen(int type_arg);
13+
int update_screen(int type_arg);
1414
int conceal_cursor_line(win_T *wp);
1515
void conceal_check_cursur_line(void);
1616
void update_single_line(win_T *wp, linenr_T lnum);

src/screen.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,9 @@ update_curbuf(int type)
538538
/*
539539
* Based on the current value of curwin->w_topline, transfer a screenfull
540540
* of stuff from Filemem to ScreenLines[], and update curwin->w_botline.
541+
* Return OK when the screen was updated, FAIL if it was not done.
541542
*/
542-
void
543+
int
543544
update_screen(int type_arg)
544545
{
545546
int type = type_arg;
@@ -557,7 +558,7 @@ update_screen(int type_arg)
557558

558559
/* Don't do anything if the screen structures are (not yet) valid. */
559560
if (!screen_valid(TRUE))
560-
return;
561+
return FAIL;
561562

562563
if (type == VALID_NO_UPDATE)
563564
{
@@ -589,7 +590,7 @@ update_screen(int type_arg)
589590
must_redraw = type;
590591
if (type > INVERTED_ALL)
591592
curwin->w_lines_valid = 0; /* don't use w_lines[].wl_size now */
592-
return;
593+
return FAIL;
593594
}
594595

595596
updating_screen = TRUE;
@@ -842,6 +843,7 @@ update_screen(int type_arg)
842843
gui_update_scrollbars(FALSE);
843844
}
844845
#endif
846+
return OK;
845847
}
846848

847849
#if defined(FEAT_SIGNS) || defined(FEAT_GUI) || defined(FEAT_CONCEAL)

src/terminal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
* TODO:
4141
* - patch to use GUI or cterm colors for vterm. Yasuhiro, #2067
4242
* - patch to add tmap, jakalope (Jacob Askeland) #2073
43-
* - Redirecting output does not work on MS-Windows.
43+
* - Redirecting output does not work on MS-Windows, Test_terminal_redir_file()
44+
* is disabled.
45+
* - test_terminal_no_cmd hangs (Christian)
4446
* - implement term_setsize()
4547
* - add test for giving error for invalid 'termsize' value.
4648
* - support minimal size when 'termsize' is "rows*cols".
@@ -1543,7 +1545,8 @@ terminal_loop(void)
15431545
/* TODO: skip screen update when handling a sequence of keys. */
15441546
/* Repeat redrawing in case a message is received while redrawing. */
15451547
while (curwin->w_redr_type != 0)
1546-
update_screen(0);
1548+
if (update_screen(0) == FAIL)
1549+
break;
15471550
update_cursor(curbuf->b_term, FALSE);
15481551

15491552
c = term_vgetc();

src/version.c

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

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1100,
772774
/**/
773775
1099,
774776
/**/

0 commit comments

Comments
 (0)