Skip to content

Commit 2e48567

Browse files
nwounknchrisbra
authored andcommitted
patch 9.1.0855: setting 'cmdheight' may cause hit-enter-prompt
Problem: setting 'cmdheight' may cause hit-enter-prompt and echo output to be missing Solution: Before cleaning the cmdline, check the need_wait_return flag (nwounkn) closes: #13432 Signed-off-by: nwounkn <nwounkn@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent feea1b4 commit 2e48567

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
|~+0#4040ff13#ffffff0| @73
2+
|~| @73
3+
|~| @73
4+
|~| @73
5+
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
6+
|f+0&&|o@1| @71
7+
|b|a|r| @71
8+
|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

src/testdir/test_cmdline.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ func Test_changing_cmdheight()
270270

271271
let lines =<< trim END
272272
set cmdheight=1 laststatus=2
273+
func EchoOne()
274+
set laststatus=2 cmdheight=1
275+
echo 'foo'
276+
echo 'bar'
277+
set cmdheight=2
278+
endfunc
273279
func EchoTwo()
274280
set laststatus=2
275281
set cmdheight=5
@@ -305,6 +311,10 @@ func Test_changing_cmdheight()
305311
call term_sendkeys(buf, ":call EchoTwo()\<CR>")
306312
call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
307313

314+
" increasing 'cmdheight' doesn't clear the messages that need hit-enter
315+
call term_sendkeys(buf, ":call EchoOne()\<CR>")
316+
call VerifyScreenDump(buf, 'Test_changing_cmdheight_7', {})
317+
308318
" clean up
309319
call StopVimInTerminal(buf)
310320
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
855,
707709
/**/
708710
854,
709711
/**/

src/window.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7343,11 +7343,14 @@ command_height(void)
73437343
// Recompute window positions.
73447344
(void)win_comp_pos();
73457345

7346-
// clear the lines added to cmdline
7347-
if (full_screen)
7348-
screen_fill(cmdline_row, (int)Rows, 0,
7349-
(int)Columns, ' ', ' ', 0);
7350-
msg_row = cmdline_row;
7346+
if (!need_wait_return)
7347+
{
7348+
// clear the lines added to cmdline
7349+
if (full_screen)
7350+
screen_fill(cmdline_row, (int)Rows, 0,
7351+
(int)Columns, ' ', ' ', 0);
7352+
msg_row = cmdline_row;
7353+
}
73517354
redraw_cmdline = TRUE;
73527355
return;
73537356
}

0 commit comments

Comments
 (0)