aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/cmdline_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:15:05 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:27:38 +0000
commitc5d770d311841ea5230426cc4c868e8db27300a8 (patch)
treedd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/functional/legacy/cmdline_spec.lua
parent9be89f131f87608f224f0ee06d199fcd09d32176 (diff)
parent081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff)
downloadrneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/legacy/cmdline_spec.lua')
-rw-r--r--test/functional/legacy/cmdline_spec.lua30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index 2e0e52117d..bf146e1322 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -15,7 +15,6 @@ describe('cmdline', function()
-- oldtest: Test_cmdlineclear_tabenter()
it('is cleared when switching tabs', function()
local screen = Screen.new(30, 10)
- screen:attach()
feed_command([[call setline(1, range(30))]])
screen:expect([[
@@ -79,7 +78,6 @@ describe('cmdline', function()
-- oldtest: Test_verbose_option()
it('prints every executed Ex command if verbose >= 16', function()
local screen = Screen.new(60, 12)
- screen:attach()
exec([[
command DoSomething echo 'hello' |set ts=4 |let v = '123' |echo v
call feedkeys("\r", 't') " for the hit-enter prompt
@@ -104,7 +102,6 @@ describe('cmdline', function()
-- oldtest: Test_cmdline_redraw_tabline()
it('tabline is redrawn on entering cmdline', function()
local screen = Screen.new(30, 6)
- screen:attach()
exec([[
set showtabline=2
autocmd CmdlineEnter * set tabline=foo
@@ -121,7 +118,6 @@ describe('cmdline', function()
-- oldtest: Test_redraw_in_autocmd()
it('cmdline cursor position is correct after :redraw with cmdheight=2', function()
local screen = Screen.new(30, 6)
- screen:attach()
exec([[
set cmdheight=2
autocmd CmdlineChanged * redraw
@@ -143,11 +139,17 @@ describe('cmdline', function()
]])
end)
- it("setting 'cmdheight' works after outputting two messages vim-patch:9.0.0665", function()
+ -- oldtest: Test_changing_cmdheight()
+ it("changing 'cmdheight'", function()
local screen = Screen.new(60, 8)
- screen:attach()
exec([[
set cmdheight=1 laststatus=2
+ func EchoOne()
+ set laststatus=2 cmdheight=1
+ echo 'foo'
+ echo 'bar'
+ set cmdheight=2
+ endfunc
func EchoTwo()
set laststatus=2
set cmdheight=5
@@ -156,6 +158,8 @@ describe('cmdline', function()
set cmdheight=1
endfunc
]])
+
+ -- setting 'cmdheight' works after outputting two messages
feed(':call EchoTwo()')
screen:expect([[
|
@@ -170,12 +174,22 @@ describe('cmdline', function()
{3:[No Name] }|
|
]])
+
+ -- increasing 'cmdheight' doesn't clear the messages that need hit-enter
+ feed(':call EchoOne()<CR>')
+ screen:expect([[
+ |
+ {1:~ }|*3
+ {3: }|
+ foo |
+ bar |
+ {6:Press ENTER or type command to continue}^ |
+ ]])
end)
-- oldtest: Test_cmdheight_tabline()
it("changing 'cmdheight' when there is a tabline", function()
local screen = Screen.new(60, 8)
- screen:attach()
api.nvim_set_option_value('laststatus', 2, {})
api.nvim_set_option_value('showtabline', 2, {})
api.nvim_set_option_value('cmdheight', 1, {})
@@ -191,7 +205,6 @@ describe('cmdline', function()
-- oldtest: Test_rulerformat_position()
it("ruler has correct position with 'rulerformat' set", function()
local screen = Screen.new(20, 3)
- screen:attach()
api.nvim_set_option_value('ruler', true, {})
api.nvim_set_option_value('rulerformat', 'longish', {})
api.nvim_set_option_value('laststatus', 0, {})
@@ -218,7 +231,6 @@ describe('cmdwin', function()
[3] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
[4] = { bold = true }, -- ModeMsg
})
- screen:attach()
command('set more')
command('autocmd WinNew * highlight')
feed('q:')