comparison src/popupwin.c @ 30222:b871016ea7c1 v9.0.0447

patch 9.0.0447: using :echowin while at the hit-enter prompt causes problems Commit: https://github.com/vim/vim/commit/cf0995d7d7301e36c81cafa14e68782f1d3be2ad Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 21:36:17 2022 +0100 patch 9.0.0447: using :echowin while at the hit-enter prompt causes problems 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Sep 2022 22:45:03 +0200
parents 088a3715ea69
children 8a25c8215d4a
comparison
equal deleted inserted replaced
30221:a5dace90aec6 30222:b871016ea7c1
29 }; 29 };
30 30
31 #ifdef HAS_MESSAGE_WINDOW 31 #ifdef HAS_MESSAGE_WINDOW
32 // Window used for ":echowindow" 32 // Window used for ":echowindow"
33 static win_T *message_win = NULL; 33 static win_T *message_win = NULL;
34
35 // Flag set when a message is added to the message window, timer is started
36 // when the message window is drawn. This might be after pressing Enter at the
37 // hit-enter prompt.
38 static int start_message_win_timer = FALSE;
39
40 static void may_start_message_win_timer(win_T *wp);
34 #endif 41 #endif
35 42
36 static void popup_adjust_position(win_T *wp); 43 static void popup_adjust_position(win_T *wp);
37 44
38 /* 45 /*
4266 4273
4267 update_popup_transparent(wp, 0); 4274 update_popup_transparent(wp, 0);
4268 4275
4269 // Back to the normal zindex. 4276 // Back to the normal zindex.
4270 screen_zindex = 0; 4277 screen_zindex = 0;
4278
4279 #ifdef HAS_MESSAGE_WINDOW
4280 // if this was the message window popup may start the timer now
4281 may_start_message_win_timer(wp);
4282 #endif
4271 } 4283 }
4272 4284
4273 #if defined(FEAT_SEARCH_EXTRA) 4285 #if defined(FEAT_SEARCH_EXTRA)
4274 // In case win_update() called start_search_hl(). 4286 // In case win_update() called start_search_hl().
4275 end_search_hl(); 4287 end_search_hl();
4511 { 4523 {
4512 // the highlight may have changed. 4524 // the highlight may have changed.
4513 popup_update_color(message_win, TYPE_MESSAGE_WIN); 4525 popup_update_color(message_win, TYPE_MESSAGE_WIN);
4514 popup_show(message_win); 4526 popup_show(message_win);
4515 } 4527 }
4528 start_message_win_timer = TRUE;
4529 }
4530 }
4531
4532 static void
4533 may_start_message_win_timer(win_T *wp)
4534 {
4535 if (wp == message_win && start_message_win_timer)
4536 {
4516 if (message_win->w_popup_timer != NULL) 4537 if (message_win->w_popup_timer != NULL)
4517 timer_start(message_win->w_popup_timer); 4538 timer_start(message_win->w_popup_timer);
4539 start_message_win_timer = FALSE;
4518 } 4540 }
4519 } 4541 }
4520 4542
4521 int 4543 int
4522 popup_message_win_visible(void) 4544 popup_message_win_visible(void)
4550 void 4572 void
4551 end_echowindow(void) 4573 end_echowindow(void)
4552 { 4574 {
4553 in_echowindow = FALSE; 4575 in_echowindow = FALSE;
4554 4576
4555 // show the message window now 4577 if ((State & MODE_HITRETURN) == 0)
4556 redraw_cmd(FALSE); 4578 // show the message window now
4579 redraw_cmd(FALSE);
4557 4580
4558 // do not overwrite messages 4581 // do not overwrite messages
4559 // TODO: only for message window 4582 // TODO: only for message window
4560 msg_didout = TRUE; 4583 msg_didout = TRUE;
4561 if (msg_col == 0) 4584 if (msg_col == 0)