mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.0191: messages test fails; window size incorrect
Problem: Messages test fails; window size incorrect when 'cmdheight' is made smaller. Solution: Properly cleanup after test with cmdheight zero. Resize windows correctly when 'cmdheight' gets smaller.
This commit is contained in:
8
src/testdir/dumps/Test_changing_cmdheight_5.dump
Normal file
8
src/testdir/dumps/Test_changing_cmdheight_5.dump
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
> +0&#ffffff0@74
|
||||||
|
|~+0#4040ff13&| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|~| @73
|
||||||
|
|[+3#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
|
||||||
|
| +0&&@74
|
@@ -239,6 +239,11 @@ func Test_changing_cmdheight()
|
|||||||
call term_sendkeys(buf, ":set cmdheight-=2\<CR>")
|
call term_sendkeys(buf, ":set cmdheight-=2\<CR>")
|
||||||
call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {})
|
call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {})
|
||||||
|
|
||||||
|
" reducing window size and then setting cmdheight
|
||||||
|
call term_sendkeys(buf, ":resize -1\<CR>")
|
||||||
|
call term_sendkeys(buf, ":set cmdheight=1\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_changing_cmdheight_5', {})
|
||||||
|
|
||||||
" clean up
|
" clean up
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('XTest_cmdheight')
|
call delete('XTest_cmdheight')
|
||||||
|
@@ -388,6 +388,7 @@ func Test_fileinfo_after_echo()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cmdheight_zero()
|
func Test_cmdheight_zero()
|
||||||
|
enew
|
||||||
set cmdheight=0
|
set cmdheight=0
|
||||||
set showcmd
|
set showcmd
|
||||||
redraw!
|
redraw!
|
||||||
@@ -437,10 +438,13 @@ func Test_cmdheight_zero()
|
|||||||
7
|
7
|
||||||
call feedkeys(":\"\<C-R>=line('w0')\<CR>\<CR>", "xt")
|
call feedkeys(":\"\<C-R>=line('w0')\<CR>\<CR>", "xt")
|
||||||
call assert_equal('"1', @:)
|
call assert_equal('"1', @:)
|
||||||
bwipe!
|
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
bwipe!
|
||||||
set cmdheight&
|
set cmdheight&
|
||||||
set showcmd&
|
set showcmd&
|
||||||
|
tabnew
|
||||||
|
tabonly
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@@ -735,6 +735,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 */
|
||||||
|
/**/
|
||||||
|
191,
|
||||||
/**/
|
/**/
|
||||||
190,
|
190,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -6555,6 +6555,12 @@ command_height(void)
|
|||||||
if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch)
|
if (p_ch > old_p_ch && cmdline_row <= Rows - p_ch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// If cmdline_row is smaller than what it is supposed to be for 'cmdheight'
|
||||||
|
// then set old_p_ch to what it would be, so that the windows get resized
|
||||||
|
// properly for the new value.
|
||||||
|
if (cmdline_row < Rows - p_ch)
|
||||||
|
old_p_ch = Rows - cmdline_row;
|
||||||
|
|
||||||
// Find bottom frame with width of screen.
|
// Find bottom frame with width of screen.
|
||||||
frp = lastwin->w_frame;
|
frp = lastwin->w_frame;
|
||||||
while (frp->fr_width != Columns && frp->fr_parent != NULL)
|
while (frp->fr_width != Columns && frp->fr_parent != NULL)
|
||||||
|
Reference in New Issue
Block a user