aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorShougo Matsushita <Shougo.Matsu@gmail.com>2022-07-31 17:06:32 +0900
committerzeertzjq <zeertzjq@outlook.com>2022-07-31 17:15:36 +0800
commit81a1d26c3eee816abaa3d0e611a8b1a0e473d3a1 (patch)
treeb4b14f57c36376c382bf9116f85aa84633749024 /src/nvim/testdir
parentabc087f4c65ca547cae58518b42aee82ff4a07f6 (diff)
downloadrneovim-81a1d26c3eee816abaa3d0e611a8b1a0e473d3a1.tar.gz
rneovim-81a1d26c3eee816abaa3d0e611a8b1a0e473d3a1.tar.bz2
rneovim-81a1d26c3eee816abaa3d0e611a8b1a0e473d3a1.zip
vim-patch:9.0.0114: the command line takes up space even when not used
Problem: The command line takes up space even when not used. Solution: Allow for 'cmdheight' to be set to zero. (Shougo Matsushita, closes vim/vim#10675, closes vim/vim#940) https://github.com/vim/vim/commit/f39cfb72629f3e7fefaf578a3faa2619cd0654f8 Omit win_redr_ruler() change: winbar may still need redraw. Omit win_update() changes: Nvim doesn't use `Rows` there. Omit redraw_asap(): removed.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_messages.vim47
-rw-r--r--src/nvim/testdir/test_window_cmd.vim4
2 files changed, 48 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_messages.vim b/src/nvim/testdir/test_messages.vim
index 2f9c562771..e6172f6c73 100644
--- a/src/nvim/testdir/test_messages.vim
+++ b/src/nvim/testdir/test_messages.vim
@@ -316,4 +316,51 @@ func Test_fileinfo_after_echo()
call delete('b.txt')
endfunc
+func Test_cmdheight_zero()
+ set cmdheight=0
+ set showcmd
+ redraw!
+
+ echo 'test echo'
+ call assert_equal(116, screenchar(&lines, 1))
+ redraw!
+
+ echomsg 'test echomsg'
+ call assert_equal(116, screenchar(&lines, 1))
+ redraw!
+
+ call feedkeys(":ls\<CR>", "xt")
+ call assert_equal(':ls', Screenline(&lines - 1))
+ redraw!
+
+ let char = getchar(0)
+ call assert_match(char, 0)
+
+ " Check change/restore cmdheight when macro
+ call feedkeys("qa", "xt")
+ call assert_equal(&cmdheight, 1)
+ call feedkeys("q", "xt")
+ call assert_equal(&cmdheight, 0)
+
+ call setline(1, 'somestring')
+ call feedkeys("y", "n")
+ %s/somestring/otherstring/gc
+ call assert_equal(getline(1), 'otherstring')
+
+ call feedkeys("g\<C-g>", "xt")
+ call assert_match(
+ \ 'Col 1 of 11; Line 1 of 1; Word 1 of 1',
+ \ Screenline(&lines))
+
+ " Check split behavior
+ for i in range(1, 10)
+ split
+ endfor
+ only
+ call assert_equal(&cmdheight, 0)
+
+ set cmdheight&
+ set showcmd&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim
index 3bfff0a577..d96fc2d789 100644
--- a/src/nvim/testdir/test_window_cmd.vim
+++ b/src/nvim/testdir/test_window_cmd.vim
@@ -1390,11 +1390,9 @@ func Test_win_move_statusline()
call assert_equal(h0, winheight(0))
call assert_equal(1, &cmdheight)
endfor
- " Nvim supports cmdheight=0
+ " supports cmdheight=0
set cmdheight=0
call assert_true(win_move_statusline(0, 1))
- "call assert_equal(h0, winheight(0))
- "call assert_equal(1, &cmdheight)
call assert_equal(h0 + 1, winheight(0))
call assert_equal(0, &cmdheight)
set cmdheight&