1
0
forked from aniani/vim

patch 8.1.0328: inputlist() doesn't work with a timer

Problem:    inputlist() doesn't work with a timer. (Dominique Pelle)
Solution:   Don't redraw when cmdline_row is zero. (Hirohito Higashi,
            closes #3239)
This commit is contained in:
Bram Moolenaar
2018-08-26 21:23:07 +02:00
parent 0529583ff1
commit 4cbdf155ca
3 changed files with 26 additions and 19 deletions

View File

@@ -3747,18 +3747,18 @@ prompt_for_number(int *mouse_used)
else else
MSG_PUTS(_("Type number and <Enter> (empty cancels): ")); MSG_PUTS(_("Type number and <Enter> (empty cancels): "));
/* Set the state such that text can be selected/copied/pasted and we still // Set the state such that text can be selected/copied/pasted and we still
* get mouse events. */ // get mouse events. redraw_after_callback() will not redraw if cmdline_row
// is zero.
save_cmdline_row = cmdline_row; save_cmdline_row = cmdline_row;
cmdline_row = 0; cmdline_row = 0;
save_State = State; save_State = State;
State = ASKMORE; /* prevents a screen update when using a timer */ State = CMDLINE;
#ifdef FEAT_MOUSE #ifdef FEAT_MOUSE
/* May show different mouse shape. */ // May show different mouse shape.
setmouse(); setmouse();
#endif #endif
i = get_number(TRUE, mouse_used); i = get_number(TRUE, mouse_used);
if (KeyTyped) if (KeyTyped)
{ {
@@ -3773,7 +3773,7 @@ prompt_for_number(int *mouse_used)
cmdline_row = save_cmdline_row; cmdline_row = save_cmdline_row;
State = save_State; State = save_State;
#ifdef FEAT_MOUSE #ifdef FEAT_MOUSE
/* May need to restore mouse shape. */ // May need to restore mouse shape.
setmouse(); setmouse();
#endif #endif

View File

@@ -447,32 +447,37 @@ redraw_after_callback(int call_update_screen)
++redrawing_for_callback; ++redrawing_for_callback;
if (State == HITRETURN || State == ASKMORE) if (State == HITRETURN || State == ASKMORE)
; /* do nothing */ ; // do nothing
else if (State & CMDLINE) else if (State & CMDLINE)
{ {
/* Redrawing only works when the screen didn't scroll. Don't clear // Don't redraw when in prompt_for_number().
* wildmenu entries. */ if (cmdline_row > 0)
{
// Redrawing only works when the screen didn't scroll. Don't clear
// wildmenu entries.
if (msg_scrolled == 0 if (msg_scrolled == 0
#ifdef FEAT_WILDMENU #ifdef FEAT_WILDMENU
&& wild_menu_showing == 0 && wild_menu_showing == 0
#endif #endif
&& call_update_screen) && call_update_screen)
update_screen(0); update_screen(0);
/* Redraw in the same position, so that the user can continue
* editing the command. */ // Redraw in the same position, so that the user can continue
// editing the command.
redrawcmdline_ex(FALSE); redrawcmdline_ex(FALSE);
} }
}
else if (State & (NORMAL | INSERT | TERMINAL)) else if (State & (NORMAL | INSERT | TERMINAL))
{ {
/* keep the command line if possible */ // keep the command line if possible
update_screen(VALID_NO_UPDATE); update_screen(VALID_NO_UPDATE);
setcursor(); setcursor();
} }
cursor_on(); cursor_on();
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use && !gui_mch_is_blink_off()) if (gui.in_use && !gui_mch_is_blink_off())
/* Don't update the cursor when it is blinking and off to avoid // Don't update the cursor when it is blinking and off to avoid
* flicker. */ // flicker.
out_flush_cursor(FALSE, FALSE); out_flush_cursor(FALSE, FALSE);
else else
#endif #endif

View File

@@ -794,6 +794,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 */
/**/
328,
/**/ /**/
327, 327,
/**/ /**/