aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/statusline_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-05-24 19:18:11 +0000
commitff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch)
tree729bbcb92231538fa61dab6c3d890b025484b7f5 /test/functional/legacy/statusline_spec.lua
parent376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff)
parent28c04948a1c887a1cc0cb64de79fa32631700466 (diff)
downloadrneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2
rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/legacy/statusline_spec.lua')
-rw-r--r--test/functional/legacy/statusline_spec.lua56
1 files changed, 20 insertions, 36 deletions
diff --git a/test/functional/legacy/statusline_spec.lua b/test/functional/legacy/statusline_spec.lua
index 567e829879..148166fdc3 100644
--- a/test/functional/legacy/statusline_spec.lua
+++ b/test/functional/legacy/statusline_spec.lua
@@ -1,8 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local exec = helpers.exec
-local feed = helpers.feed
+
+local clear = n.clear
+local exec = n.exec
+local feed = n.feed
before_each(clear)
@@ -15,11 +16,6 @@ describe('statusline', function()
end)
it('is updated in cmdline mode when using window-local statusline vim-patch:8.2.2737', function()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- [2] = { bold = true, reverse = true }, -- StatusLine
- [3] = { reverse = true }, -- StatusLineNC
- })
exec([[
setlocal statusline=-%{mode()}-
split
@@ -28,30 +24,25 @@ describe('statusline', function()
screen:expect([[
^ |
{1:~ }|
- {2:+n+ }|
+ {3:+n+ }|
|
{1:~ }|
- {3:-n- }|
+ {2:-n- }|
|
]])
feed(':')
screen:expect([[
|
{1:~ }|
- {2:+c+ }|
+ {3:+c+ }|
|
{1:~ }|
- {3:-c- }|
+ {2:-c- }|
:^ |
]])
end)
it('truncated item does not cause off-by-one highlight vim-patch:8.2.4929', function()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- [2] = { foreground = Screen.colors.Blue }, -- User1
- [3] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- User2
- })
exec([[
set laststatus=2
hi! link User1 Directory
@@ -61,20 +52,13 @@ describe('statusline', function()
screen:expect([[
^ |
{1:~ }|*4
- {3:<F}{2:GHI }|
+ {9:<F}{18:GHI }|
|
]])
end)
-- oldtest: Test_statusline_showcmd()
it('showcmdloc=statusline works', function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
- [2] = { bold = true }, -- MoreMsg
- [3] = { bold = true, reverse = true }, -- StatusLine
- [5] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, -- Folded
- })
exec([[
func MyStatusLine()
return '%S'
@@ -92,9 +76,9 @@ describe('statusline', function()
feed('g')
screen:expect([[
- {5:+-- 2 lines: a···································}|
+ {13:+-- 2 lines: a···································}|
^c |
- {0:~ }|*3
+ {1:~ }|*3
{3:g }|
|
]])
@@ -105,19 +89,19 @@ describe('statusline', function()
^a |
b |
c |
- {0:~ }|*2
+ {1:~ }|*2
{3: }|
|
]])
feed('<C-V>Gl')
screen:expect([[
- {1:a} |
- {1:b} |
- {1:c}^ |
- {0:~ }|*2
+ {17:a} |
+ {17:b} |
+ {17:c}^ |
+ {1:~ }|*2
{3:3x2 }|
- {2:-- VISUAL BLOCK --} |
+ {5:-- VISUAL BLOCK --} |
]])
feed('<Esc>1234')
@@ -125,7 +109,7 @@ describe('statusline', function()
a |
b |
^c |
- {0:~ }|*2
+ {1:~ }|*2
{3:1234 }|
|
]])
@@ -137,7 +121,7 @@ describe('statusline', function()
a |
b |
^c |
- {0:~ }|*2
+ {1:~ }|*2
{3:[No Name] [+] 1234 }|
: |
]])