aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/cmdline_spec.lua16
-rw-r--r--test/old/testdir/test_cmdline.vim11
2 files changed, 19 insertions, 8 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index 22700990c1..819b40323a 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -175,19 +175,17 @@ describe('cmdline', function()
{3:[No Name] }|
|*5
]])
- feed(':set cmdheight-=1<CR>')
-- using more space moves the status line up
feed(':set cmdheight+=1<CR>')
screen:expect([[
^ |
- {1:~ }|
{3:[No Name] }|
- |*5
+ |*6
]])
-- reducing cmdheight moves status line down
- feed(':set cmdheight-=2<CR>')
+ feed(':set cmdheight-=3<CR>')
screen:expect([[
^ |
{1:~ }|*3
@@ -231,6 +229,16 @@ describe('cmdline', function()
bar |
{6:Press ENTER or type command to continue}^ |
]])
+
+ -- window commands do not reduce 'cmdheight' to value lower than :set by user
+ feed('<CR>:wincmd _<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*4
+ {3:[No Name] }|
+ :wincmd _ |
+ |
+ ]])
end)
-- oldtest: Test_cmdheight_tabline()
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index 3fce086040..d4ad63d43e 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -294,17 +294,16 @@ func Test_changing_cmdheight()
" :resize now also changes 'cmdheight' accordingly
call term_sendkeys(buf, ":set cmdheight+=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {})
- call term_sendkeys(buf, ":set cmdheight-=1\<CR>")
" using more space moves the status line up
call term_sendkeys(buf, ":set cmdheight+=1\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_3', {})
" reducing cmdheight moves status line down
- call term_sendkeys(buf, ":set cmdheight-=2\<CR>")
+ call term_sendkeys(buf, ":set cmdheight-=3\<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', {})
@@ -313,10 +312,14 @@ func Test_changing_cmdheight()
call term_sendkeys(buf, ":call EchoTwo()\<CR>")
call VerifyScreenDump(buf, 'Test_changing_cmdheight_6', {})
- " decreasing 'cmdheight' doesn't clear the messages that need hit-enter
+ " 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', {})
+ " window commands do not reduce 'cmdheight' to value lower than :set by user
+ call term_sendkeys(buf, "\<CR>:wincmd _\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_8', {})
+
" clean up
call StopVimInTerminal(buf)
endfunc