Patch 9.0.0351
Problem: Message window may obscure the command line.
Solution: Reduce the maximum height of the message window.
Files: src/popupwin.c, src/testdir/test_messages.vim, src/eval.c,
src/testdir/dumps/Test_echowindow_4.dump
*** ../vim-9.0.0350/src/popupwin.c 2022-09-01 16:00:49.730496296 +0100
--- src/popupwin.c 2022-09-01 16:24:21.035025465 +0100
***************
*** 1356,1361 ****
--- 1356,1363 ----
if (wp->w_maxheight > 0)
maxheight = wp->w_maxheight;
+ else if (wp->w_popup_pos == POPPOS_BOTTOM)
+ maxheight = cmdline_row - 1;
// start at the desired first line
if (wp->w_firstline > 0)
***************
*** 4479,4484 ****
--- 4481,4487 ----
message_win->w_popup_pos = POPPOS_BOTTOM;
message_win->w_wantcol = 1;
message_win->w_minwidth = 9999;
+ message_win->w_firstline = -1;
// no padding, border at the top
for (i = 0; i < 4; ++i)
*** ../vim-9.0.0350/src/testdir/test_messages.vim 2022-08-31 14:46:07.915016883 +0100
--- src/testdir/test_messages.vim 2022-09-01 16:34:03.437046143 +0100
***************
*** 396,401 ****
--- 396,406 ----
echowindow a:arg
endfunc
echowindow 'first line'
+ func ManyMessages()
+ for n in range(20)
+ echowindow 'line' n
+ endfor
+ endfunc
END
call writefile(lines, 'XtestEchowindow')
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
***************
*** 407,412 ****
--- 412,420 ----
call term_sendkeys(buf, ":call popup_clear()\<CR>")
call VerifyScreenDump(buf, 'Test_echowindow_3', {})
+ call term_sendkeys(buf, ":call ManyMessages()\<CR>")
+ call VerifyScreenDump(buf, 'Test_echowindow_4', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestEchowindow')
*** ../vim-9.0.0350/src/eval.c 2022-08-31 14:46:07.907016957 +0100
--- src/eval.c 2022-09-01 15:39:32.984997674 +0100
***************
*** 6729,6735 ****
ga_init2(&ga, 1, 80);
#ifdef HAS_MESSAGE_WINDOW
! in_echowindow = (eap->cmdidx == CMD_echowindow);
#endif
if (eap->skip)
--- 6729,6736 ----
ga_init2(&ga, 1, 80);
#ifdef HAS_MESSAGE_WINDOW
! if (eap->cmdidx == CMD_echowindow)
! start_echowindow();
#endif
if (eap->skip)
***************
*** 6833,6849 ****
--emsg_skip;
#ifdef HAS_MESSAGE_WINDOW
if (eap->cmdidx == CMD_echowindow)
! {
! // show the message window now
! ex_redraw(eap);
!
! // do not overwrite messages
! // TODO: only for message window
! msg_didout = TRUE;
! if (msg_col == 0)
! msg_col = 1;
! in_echowindow = FALSE;
! }
#endif
set_nextcmd(eap, arg);
}
--- 6834,6840 ----
--emsg_skip;
#ifdef HAS_MESSAGE_WINDOW
if (eap->cmdidx == CMD_echowindow)
! end_echowindow();
#endif
set_nextcmd(eap, arg);
}
*** ../vim-9.0.0350/src/testdir/dumps/Test_echowindow_4.dump 2022-09-01 16:42:37.543939238 +0100
--- src/testdir/dumps/Test_echowindow_4.dump 2022-09-01 16:34:06.485038453 +0100
***************
*** 0 ****
--- 1,8 ----
+ >═+0#e000002#ffffff0@74
+ |l|i|n|e| |1|4| @67
+ |l|i|n|e| |1|5| @67
+ |l|i|n|e| |1|6| @67
+ |l|i|n|e| |1|7| @67
+ |l|i|n|e| |1|8| @67
+ |l|i|n|e| |1|9| @67
+ | +0#0000000&@56|1|,|1| @10|A|l@1|
*** ../vim-9.0.0350/src/version.c 2022-09-01 16:00:49.734496290 +0100
--- src/version.c 2022-09-01 16:40:48.228150009 +0100
***************
*** 709,710 ****
--- 709,712 ----
{ /* Add new patch number below this line */
+ /**/
+ 351,
/**/
--
Hacker: Someone skilled in computer programming (good guy).
Cracker: A hacker that uses his skills to crack software (bad guy).
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///