Skip to content

Commit 7f7c332

Browse files
committed
patch 7.4.1750
Problem: When a buffer gets updated while in command line mode, the screen may be messed up. Solution: Postpone the redraw when the screen is scrolled.
1 parent 30e12d2 commit 7f7c332

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/channel.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,7 @@ channel_write_new_lines(buf_T *buf)
14311431

14321432
/*
14331433
* Invoke the "callback" on channel "channel".
1434+
* This does not redraw but sets channel_need_redraw;
14341435
*/
14351436
static void
14361437
invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
@@ -1445,8 +1446,7 @@ invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
14451446
call_func(callback, (int)STRLEN(callback),
14461447
&rettv, 2, argv, 0L, 0L, &dummy, TRUE, partial, NULL);
14471448
clear_tv(&rettv);
1448-
1449-
redraw_after_callback();
1449+
channel_need_redraw = TRUE;
14501450
}
14511451

14521452
/*
@@ -2009,6 +2009,10 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
20092009
}
20102010
}
20112011

2012+
/*
2013+
* Invoke the callback at "cbhead".
2014+
* Does not redraw but sets channel_need_redraw.
2015+
*/
20122016
static void
20132017
invoke_one_time_callback(
20142018
channel_T *channel,
@@ -2099,6 +2103,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel)
20992103

21002104
/*
21012105
* Invoke a callback for "channel"/"part" if needed.
2106+
* This does not redraw but sets channel_need_redraw when redraw is needed.
21022107
* Return TRUE when a message was handled, there might be another one.
21032108
*/
21042109
static int
@@ -3468,13 +3473,10 @@ channel_parse_messages(void)
34683473
}
34693474
}
34703475

3471-
if (channel_need_redraw && must_redraw)
3476+
if (channel_need_redraw)
34723477
{
34733478
channel_need_redraw = FALSE;
3474-
update_screen(0);
3475-
setcursor();
3476-
cursor_on();
3477-
out_flush();
3479+
redraw_after_callback();
34783480
}
34793481

34803482
return ret;

src/version.c

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

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1750,
751753
/**/
752754
1749,
753755
/**/

0 commit comments

Comments
 (0)