0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.0710: a job that writes to a buffer clears completion

Problem:    A job that writes to a buffer clears command line completion.
            (Ramel Eshed)
Solution:   Do not redraw while showing the completion menu.
This commit is contained in:
Bram Moolenaar
2017-07-12 20:24:41 +02:00
parent 8327d1df17
commit 8603356bf4
2 changed files with 15 additions and 19 deletions

View File

@@ -275,6 +275,10 @@ redraw_buf_and_status_later(buf_T *buf, int type)
{ {
win_T *wp; win_T *wp;
if (wild_menu_showing != 0)
/* Don't redraw while the command line completion is displayed, it
* would disappear. */
return;
FOR_ALL_WINDOWS(wp) FOR_ALL_WINDOWS(wp)
{ {
if (wp->w_buffer == buf) if (wp->w_buffer == buf)
@@ -444,22 +448,12 @@ redraw_after_callback(void)
; /* do nothing */ ; /* do nothing */
else if (State & CMDLINE) else if (State & CMDLINE)
{ {
/* Redrawing only works when the screen didn't scroll. */ /* Redrawing only works when the screen didn't scroll. Don't clear
if (msg_scrolled == 0) * wildmenu entries. */
{ if (msg_scrolled == 0 && wild_menu_showing == 0)
update_screen(0); update_screen(0);
compute_cmdrow();
}
else
{
/* Redraw in the same position, so that the user can continue /* Redraw in the same position, so that the user can continue
* editing the command. */ * editing the command. */
compute_cmdrow();
if (cmdline_row > msg_scrolled)
cmdline_row -= msg_scrolled;
else
cmdline_row = 0;
}
redrawcmdline_ex(FALSE); redrawcmdline_ex(FALSE);
} }
else if (State & (NORMAL | INSERT)) else if (State & (NORMAL | INSERT))
@@ -9417,9 +9411,9 @@ setcursor(void)
/* /*
* insert 'line_count' lines at 'row' in window 'wp' * Insert 'line_count' lines at 'row' in window 'wp'.
* if 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated. * If 'invalid' is TRUE the wp->w_lines[].wl_lnum is invalidated.
* if 'mayclear' is TRUE the screen will be cleared if it is faster than * If 'mayclear' is TRUE the screen will be cleared if it is faster than
* scrolling. * scrolling.
* Returns FAIL if the lines are not inserted, OK for success. * Returns FAIL if the lines are not inserted, OK for success.
*/ */
@@ -9502,7 +9496,7 @@ win_ins_lines(
} }
/* /*
* delete "line_count" window lines at "row" in window "wp" * Delete "line_count" window lines at "row" in window "wp".
* If "invalid" is TRUE curwin->w_lines[] is invalidated. * If "invalid" is TRUE curwin->w_lines[] is invalidated.
* If "mayclear" is TRUE the screen will be cleared if it is faster than * If "mayclear" is TRUE the screen will be cleared if it is faster than
* scrolling * scrolling

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
710,
/**/ /**/
709, 709,
/**/ /**/