diff options
Diffstat (limited to 'test/functional/ui/cmdline_spec.lua')
-rw-r--r-- | test/functional/ui/cmdline_spec.lua | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index 3b273fd229..0aee34d367 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -5,6 +5,8 @@ local source = helpers.source local command = helpers.command local assert_alive = helpers.assert_alive local uname = helpers.uname +local eval = helpers.eval +local eq = helpers.eq local function new_screen(opt) local screen = Screen.new(25, 5) @@ -858,3 +860,156 @@ describe("cmdline height", function() assert_alive() end) end) + +describe('cmdheight=0', function() + local screen + before_each(function() + clear() + screen = Screen.new(25, 5) + screen:attach() + end) + + it("with cmdheight=1 noruler laststatus=2", function() + command("set cmdheight=1 noruler laststatus=2") + screen:expect{grid=[[ + ^ | + ~ | + ~ | + [No Name] | + | + ]]} + end) + + it("with cmdheight=0 noruler laststatus=2", function() + command("set cmdheight=0 noruler laststatus=2") + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + [No Name] | + ]]} + end) + + it("with cmdheight=0 ruler laststatus=0", function() + command("set cmdheight=0 ruler laststatus=0") + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + ~ | + ]]} + end) + + it("with cmdheight=0 ruler laststatus=0", function() + command("set cmdheight=0 noruler laststatus=0 showmode") + feed('i') + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + ~ | + ]], showmode={}} + feed('<Esc>') + eq(0, eval('&cmdheight')) + end) + + it("with showmode", function() + command("set cmdheight=1 noruler laststatus=0 showmode") + feed('i') + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + -- INSERT -- | + ]]} + feed('<Esc>') + eq(1, eval('&cmdheight')) + end) + + it("when using command line", function() + command("set cmdheight=0 noruler laststatus=0") + feed(':') + screen:expect{grid=[[ + | + ~ | + ~ | + ~ | + :^ | + ]]} + eq(1, eval('&cmdheight')) + feed('<cr>') + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + ~ | + ]], showmode={}} + eq(0, eval('&cmdheight')) + end) + + it("when using input()", function() + command("set cmdheight=0 noruler laststatus=0") + feed(':call input("foo >")<cr>') + screen:expect{grid=[[ + | + ~ | + ~ | + ~ | + foo >^ | + ]]} + eq(1, eval('&cmdheight')) + feed('<cr>') + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + ~ | + ]], showmode={}} + eq(0, eval('&cmdheight')) + end) + + it("with winbar and splits", function() + command("set cmdheight=0 noruler laststatus=3 winbar=foo") + feed(':split<CR>') + screen:expect{grid=[[ + foo | + | + E36: Not enough room | + Press ENTER or type comma| + nd to continue^ | + ]]} + feed('<CR>') + screen:expect{grid=[[ + foo | + ^ | + ~ | + ~ | + [No Name] | + ]]} + feed(':') + screen:expect{grid=[[ + foo | + | + ~ | + [No Name] | + :^ | + ]]} + feed('<Esc>') + screen:expect{grid=[[ + foo | + ^ | + ~ | + ~ | + [No Name] | + ]], showmode={}} + eq(0, eval('&cmdheight')) + + assert_alive() + end) +end) |