diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2023-08-17 23:16:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 23:16:19 +0100 |
commit | 9f7e7455c01718c696e132513fd449235bd4f865 (patch) | |
tree | 3324b832529d2018a3ba1b289f73489ad5d851aa /test/old | |
parent | 7dcbe74234cae6192d11c25dbcd801d35e604eb0 (diff) | |
download | rneovim-9f7e7455c01718c696e132513fd449235bd4f865.tar.gz rneovim-9f7e7455c01718c696e132513fd449235bd4f865.tar.bz2 rneovim-9f7e7455c01718c696e132513fd449235bd4f865.zip |
vim-patch:9.0.1726: incorrect heights in win_size_restore() (#24765)
Problem: incorrect heights in win_size_restore()
Solution: avoid restoring incorrect heights in win_size_restore()
https://github.com/vim/vim/commit/876f5fb570d8401aa4c58af4a5da91f10520aa9d
I already merged this prior, so just replace the new test with the old one,
but add a test case for the global statusline.
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_cmdwin.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/old/testdir/test_cmdwin.vim b/test/old/testdir/test_cmdwin.vim index f948d46be1..f07fd99f8a 100644 --- a/test/old/testdir/test_cmdwin.vim +++ b/test/old/testdir/test_cmdwin.vim @@ -63,5 +63,34 @@ func Test_cmdwin_split_often() let &columns = columns endfunc +func Test_cmdwin_restore_heights() + set showtabline=0 cmdheight=2 laststatus=0 + call feedkeys("q::set cmdheight=1\<CR>:q\<CR>", 'ntx') + call assert_equal(&lines - 1, winheight(0)) + + set showtabline=2 cmdheight=3 + call feedkeys("q::set showtabline=0\<CR>:q\<CR>", 'ntx') + call assert_equal(&lines - 3, winheight(0)) + + set cmdheight=1 laststatus=2 + call feedkeys("q::set laststatus=0\<CR>:q\<CR>", 'ntx') + call assert_equal(&lines - 1, winheight(0)) + + set laststatus=2 + call feedkeys("q::set laststatus=1\<CR>:q\<CR>", 'ntx') + call assert_equal(&lines - 1, winheight(0)) + + set laststatus=2 + belowright vsplit + wincmd _ + let restcmds = winrestcmd() + call feedkeys("q::set laststatus=1\<CR>:q\<CR>", 'ntx') + " As we have 2 windows, &ls = 1 should still have a statusline on the last + " window. As such, the number of available rows hasn't changed and the window + " sizes should be restored. + call assert_equal(restcmds, winrestcmd()) + + set cmdheight& showtabline& laststatus& +endfunc " vim: shiftwidth=2 sts=2 expandtab |