aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-17 10:19:16 +0800
committerGitHub <noreply@github.com>2022-08-17 10:19:16 +0800
commit5c1eb02b05cd2e8cac330c85a2492846b2e4990d (patch)
treea503a2989c51957a6e6e53eda62430784572b6b7 /src/nvim/testdir
parentd74f9c3b947677a98103c41e0c4ad8ae54389c4e (diff)
parent9a6d3bd76e1edcedf71f31dfa5e1600c1c5d2c3a (diff)
downloadrneovim-5c1eb02b05cd2e8cac330c85a2492846b2e4990d.tar.gz
rneovim-5c1eb02b05cd2e8cac330c85a2492846b2e4990d.tar.bz2
rneovim-5c1eb02b05cd2e8cac330c85a2492846b2e4990d.zip
Merge pull request #19801 from Shougo/vim-9.0.0190
vim-patch:9.0.{0190,0191,0192}: cmdheight=0 fixes
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_cmdline.vim34
-rw-r--r--src/nvim/testdir/test_messages.vim6
2 files changed, 39 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index b9eefa937a..b9f027afb2 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -126,6 +126,40 @@ func Test_wildmenu_screendump()
call delete('XTest_wildmenu')
endfunc
+func Test_changing_cmdheight()
+ CheckScreendump
+
+ let lines =<< trim END
+ set cmdheight=1 laststatus=2
+ END
+ call writefile(lines, 'XTest_cmdheight')
+
+ let buf = RunVimInTerminal('-S XTest_cmdheight', {'rows': 8})
+ call term_sendkeys(buf, ":resize -3\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_1', {})
+
+ " using the space available doesn't change the status line
+ call term_sendkeys(buf, ":set cmdheight+=3\<CR>")
+ call VerifyScreenDump(buf, 'Test_changing_cmdheight_2', {})
+
+ " 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 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
+ call StopVimInTerminal(buf)
+ call delete('XTest_cmdheight')
+endfunc
+
func Test_map_completion()
if !has('cmdline_compl')
return
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim
index e181641a3b..3a607ff533 100644
--- a/src/nvim/testdir/test_messages.vim
+++ b/src/nvim/testdir/test_messages.vim
@@ -376,6 +376,7 @@ func Test_fileinfo_after_echo()
endfunc
func Test_cmdheight_zero()
+ enew
set cmdheight=0
set showcmd
redraw!
@@ -425,10 +426,13 @@ func Test_cmdheight_zero()
7
call feedkeys(":\"\<C-R>=line('w0')\<CR>\<CR>", "xt")
call assert_equal('"1', @:)
- bwipe!
+ bwipe!
+ bwipe!
set cmdheight&
set showcmd&
+ tabnew
+ tabonly
endfunc
" vim: shiftwidth=2 sts=2 expandtab