aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-06 09:03:49 +0800
committerGitHub <noreply@github.com>2022-10-06 09:03:49 +0800
commitbc64aa435b84bb3a43501e101c51507c75fbd349 (patch)
treebb75d9fed367173cd77bcbf6ccc8206a9c476f95 /src/nvim/testdir
parent6ae4a6e0711035a8a0801dd6fdb545e020bccd70 (diff)
downloadrneovim-bc64aa435b84bb3a43501e101c51507c75fbd349.tar.gz
rneovim-bc64aa435b84bb3a43501e101c51507c75fbd349.tar.bz2
rneovim-bc64aa435b84bb3a43501e101c51507c75fbd349.zip
vim-patch:9.0.0665: setting 'cmdheight' has no effect if last window was resized (#20500)
Problem: Setting 'cmdheight' has no effect if last window was resized. Solution: Do apply 'cmdheight' when told to. Use the frame height instead of the cmdline_row. (closes vim/vim#11286) https://github.com/vim/vim/commit/0816f473ab2f6cf7d8311c0f97371cada7f20d18
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 60f6930c35..b177a9cc9e 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -186,8 +186,15 @@ func Test_changing_cmdheight()
let lines =<< trim END
set cmdheight=1 laststatus=2
+ func EchoTwo()
+ set laststatus=2
+ set cmdheight=5
+ echo 'foo'
+ echo 'bar'
+ set cmdheight=1
+ endfunc
END
- call writefile(lines, 'XTest_cmdheight')
+ call writefile(lines, 'XTest_cmdheight', 'D')
let buf = RunVimInTerminal('-S XTest_cmdheight', {'rows': 8})
call term_sendkeys(buf, ":resize -3\<CR>")
@@ -205,14 +212,17 @@ func Test_changing_cmdheight()
call term_sendkeys(buf, ":set cmdheight-=2\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_4', {})
- " reducing window size and then setting cmdheight
+ " 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', {})
+ " setting 'cmdheight' works after outputting two messages
+ call term_sendkeys(buf, ":call EchoTwo()\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
+
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_cmdheight')
endfunc
func Test_map_completion()