diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-11 21:36:17 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-11 21:36:17 +0100 |
commit | cf0995d7d7301e36c81cafa14e68782f1d3be2ad (patch) | |
tree | b43bbb3633a186f9b80bb3285b357ef515acc2bd /src/popupwin.c | |
parent | 87e74d0e03c6c0267546b2e3a49316f3e84d9794 (diff) | |
download | vim-git-cf0995d7d7301e36c81cafa14e68782f1d3be2ad.tar.gz |
patch 9.0.0447: using :echowin while at the hit-enter prompt causes problemsv9.0.0447
Problem: Using :echowin while at the hit-enter prompt causes problems.
Solution: Do not prompt for :echowin. Postpone showing the message window.
Start the timer when the window is displayed.
Diffstat (limited to 'src/popupwin.c')
-rw-r--r-- | src/popupwin.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index d02196ef5..fce4a2b81 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -31,6 +31,13 @@ static poppos_entry_T poppos_entries[] = { #ifdef HAS_MESSAGE_WINDOW // Window used for ":echowindow" static win_T *message_win = NULL; + +// Flag set when a message is added to the message window, timer is started +// when the message window is drawn. This might be after pressing Enter at the +// hit-enter prompt. +static int start_message_win_timer = FALSE; + +static void may_start_message_win_timer(win_T *wp); #endif static void popup_adjust_position(win_T *wp); @@ -4268,6 +4275,11 @@ update_popups(void (*win_update)(win_T *wp)) // Back to the normal zindex. screen_zindex = 0; + +#ifdef HAS_MESSAGE_WINDOW + // if this was the message window popup may start the timer now + may_start_message_win_timer(wp); +#endif } #if defined(FEAT_SEARCH_EXTRA) @@ -4513,8 +4525,18 @@ popup_show_message_win(void) popup_update_color(message_win, TYPE_MESSAGE_WIN); popup_show(message_win); } + start_message_win_timer = TRUE; + } +} + + static void +may_start_message_win_timer(win_T *wp) +{ + if (wp == message_win && start_message_win_timer) + { if (message_win->w_popup_timer != NULL) timer_start(message_win->w_popup_timer); + start_message_win_timer = FALSE; } } @@ -4552,8 +4574,9 @@ end_echowindow(void) { in_echowindow = FALSE; - // show the message window now - redraw_cmd(FALSE); + if ((State & MODE_HITRETURN) == 0) + // show the message window now + redraw_cmd(FALSE); // do not overwrite messages // TODO: only for message window |