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 #10675, closes #940)
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index acdbe18..ea5aee1 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -387,4 +387,51 @@
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