Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cmdheight increase overwrites messages that need hit-enter #13432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/testdir/dumps/Test_changing_cmdheight_7.dump
@@ -0,0 +1,8 @@
|~+0#4040ff13#ffffff0| @73
|~| @73
|~| @73
|~| @73
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
|f+0&&|o@1| @71
|b|a|r| @71
|P+0#00e0003&|r|e|s@1| |E|N|T|E|R| |o|r| |t|y|p|e| |c|o|m@1|a|n|d| |t|o| |c|o|n|t|i|n|u|e> +0#0000000&@35
10 changes: 10 additions & 0 deletions src/testdir/test_cmdline.vim
Expand Up @@ -270,6 +270,12 @@ func Test_changing_cmdheight()

let lines =<< trim END
set cmdheight=1 laststatus=2
func EchoOne()
set laststatus=2 cmdheight=1
echo 'foo'
echo 'bar'
set cmdheight=2
endfunc
func EchoTwo()
set laststatus=2
set cmdheight=5
Expand Down Expand Up @@ -305,6 +311,10 @@ func Test_changing_cmdheight()
call term_sendkeys(buf, ":call EchoTwo()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})

" increasing 'cmdheight' doesn't clear the messages that need hit-enter
call term_sendkeys(buf, ":call EchoOne()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_7', {})

" clean up
call StopVimInTerminal(buf)
endfunc
Expand Down
13 changes: 8 additions & 5 deletions src/window.c
Expand Up @@ -7165,11 +7165,14 @@ command_height(void)
// Recompute window positions.
(void)win_comp_pos();

// clear the lines added to cmdline
if (full_screen)
screen_fill(cmdline_row, (int)Rows, 0,
(int)Columns, ' ', ' ', 0);
msg_row = cmdline_row;
if (!need_wait_return)
{
// clear the lines added to cmdline
if (full_screen)
screen_fill(cmdline_row, (int)Rows, 0,
(int)Columns, ' ', ' ', 0);
msg_row = cmdline_row;
}
redraw_cmdline = TRUE;
return;
}
Expand Down