mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0351: message window may obscure the command line
Problem: Message window may obscure the command line. Solution: Reduce the maximum height of the message window.
This commit is contained in:
15
src/eval.c
15
src/eval.c
@@ -6729,7 +6729,8 @@ ex_execute(exarg_T *eap)
|
|||||||
|
|
||||||
ga_init2(&ga, 1, 80);
|
ga_init2(&ga, 1, 80);
|
||||||
#ifdef HAS_MESSAGE_WINDOW
|
#ifdef HAS_MESSAGE_WINDOW
|
||||||
in_echowindow = (eap->cmdidx == CMD_echowindow);
|
if (eap->cmdidx == CMD_echowindow)
|
||||||
|
start_echowindow();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (eap->skip)
|
if (eap->skip)
|
||||||
@@ -6833,17 +6834,7 @@ ex_execute(exarg_T *eap)
|
|||||||
--emsg_skip;
|
--emsg_skip;
|
||||||
#ifdef HAS_MESSAGE_WINDOW
|
#ifdef HAS_MESSAGE_WINDOW
|
||||||
if (eap->cmdidx == CMD_echowindow)
|
if (eap->cmdidx == CMD_echowindow)
|
||||||
{
|
end_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
|
#endif
|
||||||
set_nextcmd(eap, arg);
|
set_nextcmd(eap, arg);
|
||||||
}
|
}
|
||||||
|
@@ -1356,6 +1356,8 @@ popup_adjust_position(win_T *wp)
|
|||||||
|
|
||||||
if (wp->w_maxheight > 0)
|
if (wp->w_maxheight > 0)
|
||||||
maxheight = wp->w_maxheight;
|
maxheight = wp->w_maxheight;
|
||||||
|
else if (wp->w_popup_pos == POPPOS_BOTTOM)
|
||||||
|
maxheight = cmdline_row - 1;
|
||||||
|
|
||||||
// start at the desired first line
|
// start at the desired first line
|
||||||
if (wp->w_firstline > 0)
|
if (wp->w_firstline > 0)
|
||||||
@@ -4479,6 +4481,7 @@ popup_get_message_win(void)
|
|||||||
message_win->w_popup_pos = POPPOS_BOTTOM;
|
message_win->w_popup_pos = POPPOS_BOTTOM;
|
||||||
message_win->w_wantcol = 1;
|
message_win->w_wantcol = 1;
|
||||||
message_win->w_minwidth = 9999;
|
message_win->w_minwidth = 9999;
|
||||||
|
message_win->w_firstline = -1;
|
||||||
|
|
||||||
// no padding, border at the top
|
// no padding, border at the top
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
|
8
src/testdir/dumps/Test_echowindow_4.dump
Normal file
8
src/testdir/dumps/Test_echowindow_4.dump
Normal file
@@ -0,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|
|
@@ -396,6 +396,11 @@ func Test_echowindow()
|
|||||||
echowindow a:arg
|
echowindow a:arg
|
||||||
endfunc
|
endfunc
|
||||||
echowindow 'first line'
|
echowindow 'first line'
|
||||||
|
func ManyMessages()
|
||||||
|
for n in range(20)
|
||||||
|
echowindow 'line' n
|
||||||
|
endfor
|
||||||
|
endfunc
|
||||||
END
|
END
|
||||||
call writefile(lines, 'XtestEchowindow')
|
call writefile(lines, 'XtestEchowindow')
|
||||||
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
|
let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
|
||||||
@@ -407,6 +412,9 @@ func Test_echowindow()
|
|||||||
call term_sendkeys(buf, ":call popup_clear()\<CR>")
|
call term_sendkeys(buf, ":call popup_clear()\<CR>")
|
||||||
call VerifyScreenDump(buf, 'Test_echowindow_3', {})
|
call VerifyScreenDump(buf, 'Test_echowindow_3', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":call ManyMessages()\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_echowindow_4', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XtestEchowindow')
|
call delete('XtestEchowindow')
|
||||||
|
@@ -707,6 +707,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 */
|
||||||
|
/**/
|
||||||
|
351,
|
||||||
/**/
|
/**/
|
||||||
350,
|
350,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user