aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/cmdline_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2023-07-26 21:27:35 +0100
committerGitHub <noreply@github.com>2023-07-26 21:27:35 +0100
commit8fe9f41f7f9da2009d11855ec0548b9dbe548a69 (patch)
tree8759d99d2b3f034449a0ac73dd0d77736d1c2aec /test/functional/ui/cmdline_spec.lua
parentccf328172bac2b02f9bd19fa58e105958514a28a (diff)
parenta47be0b2d90b26905866faf5b7cc82d9c17be9bb (diff)
downloadrneovim-8fe9f41f7f9da2009d11855ec0548b9dbe548a69.tar.gz
rneovim-8fe9f41f7f9da2009d11855ec0548b9dbe548a69.tar.bz2
rneovim-8fe9f41f7f9da2009d11855ec0548b9dbe548a69.zip
Merge pull request #24457 from seandewar/relax-cmdwin
feat(api): relax cmdwin restrictions for a few functions
Diffstat (limited to 'test/functional/ui/cmdline_spec.lua')
-rw-r--r--test/functional/ui/cmdline_spec.lua34
1 files changed, 33 insertions, 1 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index dc29b765bd..a8cc8e00f0 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -984,14 +984,46 @@ it('tabline is not redrawn in Ex mode #24122', function()
end)
describe("cmdline height", function()
+ before_each(clear)
+
it("does not crash resized screen #14263", function()
- clear()
local screen = Screen.new(25, 10)
screen:attach()
command('set cmdheight=9999')
screen:try_resize(25, 5)
assert_alive()
end)
+
+ it('unchanged when trying to restore window sizes', function()
+ command('set showtabline=0 cmdheight=2 laststatus=0')
+ feed('q:') -- Closing cmdwin tries to restore sizes
+ command('set cmdheight=1 | quit')
+ eq(1, eval('&cmdheight'))
+
+ command('set showtabline=2 cmdheight=3')
+ feed('q:')
+ command('set showtabline=0 | quit')
+ eq(3, eval('&cmdheight'))
+
+ command('set cmdheight=1 laststatus=2')
+ feed('q:')
+ command('set laststatus=0 | quit')
+ eq(1, eval('&cmdheight'))
+
+ command('set laststatus=2')
+ feed('q:')
+ command('set laststatus=1 | quit')
+ eq(1, eval('&cmdheight'))
+
+ command('set laststatus=2 | belowright vsplit | wincmd _')
+ local restcmds = eval('winrestcmd()')
+ feed('q:')
+ command('set laststatus=1 | quit')
+ -- As we have 2 windows, &ls = 1 should still have a statusline on the last
+ -- window. As such, the number of available rows hasn't changed and the window
+ -- sizes should be restored.
+ eq(restcmds, eval('winrestcmd()'))
+ end)
end)
describe('cmdheight=0', function()