patch 9.0.0340: the 'cmdheight' zero support causes too much trouble
Problem: The 'cmdheight' zero support causes too much trouble.
Solution: Revert support for 'cmdheight' being zero.
diff --git a/src/testdir/dumps/Test_cmdheight_zero_1.dump b/src/testdir/dumps/Test_cmdheight_zero_1.dump
deleted file mode 100644
index 6fd15a0..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_1.dump
+++ /dev/null
@@ -1,6 +0,0 @@
->s+0&#ffffff0|o|m|e| |t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
diff --git a/src/testdir/dumps/Test_cmdheight_zero_2.dump b/src/testdir/dumps/Test_cmdheight_zero_2.dump
deleted file mode 100644
index d8c3aea..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_2.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#e0e0e08|o|m|e| >t+0&#ffffff0|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
diff --git a/src/testdir/dumps/Test_cmdheight_zero_3.dump b/src/testdir/dumps/Test_cmdheight_zero_3.dump
deleted file mode 100644
index ea83d3d..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_3.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|═+0#e000002&@74
-|m|e|s@1|a|g|e| |w|i|n|d|o|w| @60
diff --git a/src/testdir/dumps/Test_cmdheight_zero_4.dump b/src/testdir/dumps/Test_cmdheight_zero_4.dump
deleted file mode 100644
index a91d971..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_4.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|═+0#e000002&@74
-|T|y|p|e| @1|:|q|a|!| @1|a|n|d| |p|r|e|s@1| |<|E|n|t|e|r|>| |t|o| |a|b|a|n|d|o|n| |a|l@1| |c|h|a|n|g|e|s| |a|n|d| |e|x|i|t| |V|i|m| @9
diff --git a/src/testdir/dumps/Test_cmdheight_zero_5.dump b/src/testdir/dumps/Test_cmdheight_zero_5.dump
deleted file mode 100644
index dd64210..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_5.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|═+0#e000002&@74
-|"|X|s|o|m|e|T|e|x|t|"| |[|N|e|w|]| |1|L|,| |1|0|B| |w|r|i|t@1|e|n| @41
diff --git a/src/testdir/dumps/Test_cmdheight_zero_6.dump b/src/testdir/dumps/Test_cmdheight_zero_6.dump
deleted file mode 100644
index 7af84c9..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_6.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-|~| @73
diff --git a/src/testdir/dumps/Test_cmdheight_zero_7.dump b/src/testdir/dumps/Test_cmdheight_zero_7.dump
deleted file mode 100644
index 3c57623..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_7.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|~| @73
-|═+0#e000002&@74
-|s|o|m|e| |t|e|x|t| @65
-|s|o|m|e| |m|o|r|e| |t|e|x|t| @60
diff --git a/src/testdir/dumps/Test_cmdheight_zero_8.dump b/src/testdir/dumps/Test_cmdheight_zero_8.dump
deleted file mode 100644
index 6dbd42c..0000000
--- a/src/testdir/dumps/Test_cmdheight_zero_8.dump
+++ /dev/null
@@ -1,6 +0,0 @@
-|s+0&#ffffff0|o|m|e| >t|e|x|t| @65
-|~+0#4040ff13&| @73
-|═+0#e000002&@74
-|s|o|m|e| |t|e|x|t| @65
-|s|o|m|e| |m|o|r|e| |t|e|x|t| @60
-|e|v|e|n| |m|o|r|e| |t|e|x|t| @60
diff --git a/src/testdir/gen_opt_test.vim b/src/testdir/gen_opt_test.vim
index a552160..83f43f7 100644
--- a/src/testdir/gen_opt_test.vim
+++ b/src/testdir/gen_opt_test.vim
@@ -27,7 +27,7 @@
" Two lists with values: values that work and values that fail.
" When not listed, "othernum" or "otherstring" is used.
let test_values = {
- \ 'cmdheight': [[0, 1, 2, 10], [-1]],
+ \ 'cmdheight': [[1, 2, 10], [-1, 0]],
\ 'cmdwinheight': [[1, 2, 10], [-1, 0]],
\ 'columns': [[12, 80], [-1, 0, 10]],
\ 'conceallevel': [[0, 1, 2, 3], [-1, 4, 99]],
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 2c89748..6bdaedf 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -387,156 +387,6 @@
call delete('b.txt')
endfunc
-func Test_cmdheight_zero()
- enew
- set cmdheight=0
- set showcmd
- redraw!
- let using_popupwin = has('timers') && has('popupwin')
-
- echo 'test echo'
- if using_popupwin
- redraw
- call assert_equal('test echo', Screenline(&lines))
-
- " check that the popup is cleared when entering a command line
- call feedkeys(':', 'xt')
- redraw
- call assert_equal('~', Screenline(&lines))
- else
- call assert_equal(116, screenchar(&lines, 1))
- endif
- redraw!
-
- echomsg 'test echomsg'
- if using_popupwin
- redraw
- call assert_equal('test echomsg', Screenline(&lines))
- else
- call assert_equal(116, screenchar(&lines, 1))
- endif
- redraw!
-
- if !using_popupwin
- call feedkeys(":ls\<CR>", "xt")
- call assert_equal(':ls', Screenline(&lines))
- redraw!
- endif
-
- let char = getchar(0)
- call assert_match(char, 0)
-
- " Check change/restore cmdheight when macro
- call feedkeys("qa", "xt")
- call assert_equal(1, &cmdheight)
- call feedkeys("q", "xt")
- call assert_equal(0, &cmdheight)
-
- call setline(1, 'somestring')
- call feedkeys("y", "n")
- %s/somestring/otherstring/gc
- call assert_equal('otherstring', getline(1))
-
- call feedkeys("g\<C-g>", "xt")
- if using_popupwin
- redraw
- endif
- 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(0, &cmdheight)
-
- " Check that pressing ":" should not scroll a window
- " Check for what patch 9.0.0115 fixes
- botright 10new
- call setline(1, range(12))
- 7
- call feedkeys(":\"\<C-R>=line('w0')\<CR>\<CR>", "xt")
- call assert_equal('"1', @:)
-
- bwipe!
- bwipe!
- set cmdheight&
- set showcmd&
- tabnew
- tabonly
-
- "redraw to hide the popup window
- redraw
-endfunc
-
-func Test_cmdheight_zero_dump()
- CheckScreendump
-
- let lines =<< trim END
- set cmdheight=0
- set showmode
- call setline(1, 'some text')
- func ShowMessages()
- echomsg 'some text'
- sleep 100m
- echomsg 'some more text'
- sleep 2500m
- echomsg 'even more text'
- endfunc
- END
- call writefile(lines, 'XtestCmdheight')
- let buf = RunVimInTerminal('-S XtestCmdheight', #{rows: 6})
- " The "-- INSERT --" indicator should not be visible.
- call term_sendkeys(buf, "i")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_1', {})
-
- " The "-- VISUAL --" indicator should not be visible.
- call term_sendkeys(buf, "\<Esc>vw")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_2', {})
-
- " Echo'd text is in a popup window
- call term_sendkeys(buf, "\<Esc>:echo 'message window'\<CR>")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_3', {})
-
- " Message for CTRL-C is in the popup window
- call term_sendkeys(buf, "\<C-C>")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_4', {})
-
- " file write message is one line
- call term_sendkeys(buf, ":w XsomeText\<CR>")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_5', {})
-
- call term_sendkeys(buf, ":call popup_clear()\<CR>")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_6', {})
-
- call term_sendkeys(buf, ":call ShowMessages()\<CR>")
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_7', {})
- sleep 2
- call VerifyScreenDump(buf, 'Test_cmdheight_zero_8', {})
-
- " clean up
- call StopVimInTerminal(buf)
- call delete('XtestCmdheight')
- call delete('XsomeText')
-endfunc
-
-func Test_cmdheight_zero_shell()
- CheckUnix
-
- set cmdheight=0
- set nomore
- call setline(1, 'foo!')
- silent !echo <cWORD> > Xfile.out
- call assert_equal(['foo!'], readfile('Xfile.out'))
- call delete('Xfile.out')
- redraw!
-
- set more&
- set cmdheight&
-endfunc
-
func Test_echowindow()
CheckScreendump
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index 0fe0f11..04a5d10 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1501,12 +1501,9 @@
call assert_equal(h0, winheight(0))
call assert_equal(1, &cmdheight)
endfor
- " supports cmdheight=0
- set cmdheight=0
call assert_true(win_move_statusline(0, 1))
- call assert_equal(h0 + 1, winheight(0))
- call assert_equal(0, &cmdheight)
- set cmdheight&
+ call assert_equal(h0, winheight(0))
+ call assert_equal(1, &cmdheight)
" check win_move_statusline from bottom window on top window ID
let id = win_getid(1)
for offset in range(5)