aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/cmdline_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
committerJosh Rahm <joshuarahm@gmail.com>2025-02-05 23:09:29 +0000
commitd5f194ce780c95821a855aca3c19426576d28ae0 (patch)
treed45f461b19f9118ad2bb1f440a7a08973ad18832 /test/functional/legacy/cmdline_spec.lua
parentc5d770d311841ea5230426cc4c868e8db27300a8 (diff)
parent44740e561fc93afe3ebecfd3618bda2d2abeafb0 (diff)
downloadrneovim-d5f194ce780c95821a855aca3c19426576d28ae0.tar.gz
rneovim-d5f194ce780c95821a855aca3c19426576d28ae0.tar.bz2
rneovim-d5f194ce780c95821a855aca3c19426576d28ae0.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahm
Diffstat (limited to 'test/functional/legacy/cmdline_spec.lua')
-rw-r--r--test/functional/legacy/cmdline_spec.lua70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/functional/legacy/cmdline_spec.lua b/test/functional/legacy/cmdline_spec.lua
index bf146e1322..819b40323a 100644
--- a/test/functional/legacy/cmdline_spec.lua
+++ b/test/functional/legacy/cmdline_spec.lua
@@ -159,6 +159,50 @@ describe('cmdline', function()
endfunc
]])
+ feed(':resize -3<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*2
+ {3:[No Name] }|
+ |*4
+ ]])
+
+ -- :resize now also changes 'cmdheight' accordingly
+ feed(':set cmdheight+=1<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|
+ {3:[No Name] }|
+ |*5
+ ]])
+
+ -- using more space moves the status line up
+ feed(':set cmdheight+=1<CR>')
+ screen:expect([[
+ ^ |
+ {3:[No Name] }|
+ |*6
+ ]])
+
+ -- reducing cmdheight moves status line down
+ feed(':set cmdheight-=3<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*3
+ {3:[No Name] }|
+ |*3
+ ]])
+
+ -- reducing window size and then setting cmdheight
+ feed(':resize -1<CR>')
+ feed(':set cmdheight=1<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*5
+ {3:[No Name] }|
+ |
+ ]])
+
-- setting 'cmdheight' works after outputting two messages
feed(':call EchoTwo()')
screen:expect([[
@@ -185,6 +229,16 @@ describe('cmdline', function()
bar |
{6:Press ENTER or type command to continue}^ |
]])
+
+ -- window commands do not reduce 'cmdheight' to value lower than :set by user
+ feed('<CR>:wincmd _<CR>')
+ screen:expect([[
+ ^ |
+ {1:~ }|*4
+ {3:[No Name] }|
+ :wincmd _ |
+ |
+ ]])
end)
-- oldtest: Test_cmdheight_tabline()
@@ -216,6 +270,22 @@ describe('cmdline', function()
longish |
]]
end)
+
+ -- oldtest: Test_rulerformat_function()
+ it("'rulerformat' can use %!", function()
+ local screen = Screen.new(40, 2)
+ exec([[
+ func TestRulerFn()
+ return '10,20%=30%%'
+ endfunc
+ ]])
+ api.nvim_set_option_value('ruler', true, {})
+ api.nvim_set_option_value('rulerformat', '%!TestRulerFn()', {})
+ screen:expect([[
+ ^ |
+ 10,20 30% |
+ ]])
+ end)
end)
describe('cmdwin', function()