refactor(tests): use more global highlight definitions

This commit is contained in:
bfredl 2024-11-09 14:14:29 +01:00
parent d0e78b5871
commit 29fd5ed606
6 changed files with 963 additions and 1088 deletions

View File

@ -13,21 +13,10 @@ local eq = t.eq
local is_os = t.is_os local is_os = t.is_os
local api = n.api local api = n.api
-- TODO(bfredl): make Screen.new(cols, rows, {opts}) just work already
local function new_screen(opt) local function new_screen(opt)
local screen = Screen.new(25, 5) local screen = Screen.new(25, 5)
screen:attach(opt) screen:attach(opt)
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { reverse = true },
[3] = { bold = true, reverse = true },
[4] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[5] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[6] = { foreground = Screen.colors.Magenta },
[7] = { bold = true, foreground = Screen.colors.Brown },
[8] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[9] = { bold = true },
[10] = { background = Screen.colors.Yellow1 },
})
return screen return screen
end end
@ -189,7 +178,7 @@ local function test_cmdline(linegrid)
}, },
{ {
firstc = '=', firstc = '=',
content = { { '1', 6 }, { '+', 7 }, { '2', 6 } }, content = { { '1', 26 }, { '+', 15 }, { '2', 26 } },
pos = 3, pos = 3,
}, },
} }
@ -503,29 +492,24 @@ local function test_cmdline(linegrid)
map <f5> :let x = input({'prompt':'>','highlight':'RainBowParens'})<cr> map <f5> :let x = input({'prompt':'>','highlight':'RainBowParens'})<cr>
"map <f5> :let x = input({'prompt':'>'})<cr> "map <f5> :let x = input({'prompt':'>'})<cr>
]]) ]])
screen:set_default_attr_ids({
RBP1 = { background = Screen.colors.Red },
RBP2 = { background = Screen.colors.Yellow },
EOB = { bold = true, foreground = Screen.colors.Blue1 },
})
feed('<f5>(a(b)a)') feed('<f5>(a(b)a)')
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
{EOB:~ }|*3 {1:~ }|*3
| |
]], ]],
cmdline = { cmdline = {
{ {
prompt = '>', prompt = '>',
content = { content = {
{ '(', 'RBP1' }, { '(', 30 },
{ 'a' }, { 'a' },
{ '(', 'RBP2' }, { '(', 10 },
{ 'b' }, { 'b' },
{ ')', 'RBP2' }, { ')', 10 },
{ 'a' }, { 'a' },
{ ')', 'RBP1' }, { ')', 30 },
}, },
pos = 7, pos = 7,
}, },
@ -929,17 +913,17 @@ describe('cmdline redraw', function()
| |
{1:~ }|*3 {1:~ }|*3
{2:[No Name] }| {2:[No Name] }|
{1::}^a{8:bc} | {1::}^a{17:bc} |
{1:~ }|*2 {1:~ }|*2
{3:[Command Line] }| {3:[Command Line] }|
{9:-- VISUAL --} | {5:-- VISUAL --} |
]]) ]])
feed('<C-C>') feed('<C-C>')
screen:expect([[ screen:expect([[
| |
{1:~ }|*3 {1:~ }|*3
{2:[No Name] }| {2:[No Name] }|
{1::}a{8:bc} | {1::}a{17:bc} |
{1:~ }|*2 {1:~ }|*2
{3:[Command Line] }| {3:[Command Line] }|
:^abc | :^abc |
@ -1093,61 +1077,61 @@ describe('statusline is redrawn on entering cmdline', function()
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:c1 }| {5:c1 }|
| |
{3:c1 }| {3:c1 }|
| |
{1:~ }|*5 {1:~ }|*5
{3: }| {3: }|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{5:inue}^ | {6:inue}^ |
]], ]],
} }
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:c2 }| {5:c2 }|
| |
{3:c2 }| {3:c2 }|
| |
{1:~ }|*2 {1:~ }|*2
{3: }| {3: }|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{5:inue}^ | {6:inue}^ |
]], ]],
} }
feed(':echoerr doesnotexist<cr>') feed(':echoerr doesnotexist<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:c3 }| {5:c3 }|
| |
{3:c3 }| {3:c3 }|
{3: }| {3: }|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{4:E121: Undefined variable: doesnotex}| {9:E121: Undefined variable: doesnotex}|
{4:ist} | {9:ist} |
{5:Press ENTER or type command to cont}| {6:Press ENTER or type command to cont}|
{5:inue}^ | {6:inue}^ |
]], ]],
} }
feed('<cr>') feed('<cr>')
screen:expect { screen:expect {
grid = [[ grid = [[
{9:n3 }| {5:n3 }|
^ | ^ |
{3:n3 }| {3:n3 }|
| |
@ -1202,11 +1186,6 @@ end)
it('tabline is not redrawn in Ex mode #24122', function() it('tabline is not redrawn in Ex mode #24122', function()
clear() clear()
local screen = Screen.new(60, 5) local screen = Screen.new(60, 5)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { bold = true, reverse = true }, -- MsgSeparator
[2] = { reverse = true }, -- TabLineFill
})
screen:attach() screen:attach()
exec([[ exec([[
@ -1224,7 +1203,7 @@ it('tabline is not redrawn in Ex mode #24122', function()
grid = [[ grid = [[
{2:foo }| {2:foo }|
| |
{1: }| {3: }|
Entering Ex mode. Type "visual" to go to Normal mode. | Entering Ex mode. Type "visual" to go to Normal mode. |
:^ | :^ |
]], ]],
@ -1233,7 +1212,7 @@ it('tabline is not redrawn in Ex mode #24122', function()
feed('echo 1<CR>') feed('echo 1<CR>')
screen:expect { screen:expect {
grid = [[ grid = [[
{1: }| {3: }|
Entering Ex mode. Type "visual" to go to Normal mode. | Entering Ex mode. Type "visual" to go to Normal mode. |
:echo 1 | :echo 1 |
1 | 1 |

View File

@ -27,32 +27,30 @@ local function test_embed(ext_linegrid)
-- attach immediately after startup, for early UI -- attach immediately after startup, for early UI
screen = Screen.new(60, 8) screen = Screen.new(60, 8)
screen:attach { ext_linegrid = ext_linegrid } screen:attach { ext_linegrid = ext_linegrid }
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[1] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, [100] = { foreground = Screen.colors.NvimDarkCyan },
[2] = { bold = true, foreground = Screen.colors.SeaGreen4 }, [101] = { foreground = Screen.colors.NvimDarkRed },
[3] = { bold = true, foreground = Screen.colors.Blue1 }, [102] = {
[4] = { bold = true, foreground = Screen.colors.Green }, background = Screen.colors.NvimDarkGrey3,
[5] = { bold = true, reverse = true }, foreground = Screen.colors.NvimLightGrey3,
[6] = { foreground = Screen.colors.NvimLightGrey3, background = Screen.colors.NvimDarkGrey3 }, },
[7] = { foreground = Screen.colors.NvimDarkRed }, }
[8] = { foreground = Screen.colors.NvimDarkCyan },
})
end end
it('can display errors', function() it('can display errors', function()
startup('--cmd', 'echoerr invalid+') startup('--cmd', 'echoerr invalid+')
screen:expect([[ screen:expect([[
|*4 |*4
{6: }| {102: }|
{1:Error detected while processing pre-vimrc command line:} | {9:Error detected while processing pre-vimrc command line:} |
{1:E121: Undefined variable: invalid} | {9:E121: Undefined variable: invalid} |
{2:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
screen:expect([[ screen:expect([[
^ | ^ |
{3:~ }|*6 {1:~ }|*6
| |
]]) ]])
end) end)
@ -64,11 +62,11 @@ local function test_embed(ext_linegrid)
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"') startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
screen:expect([[ screen:expect([[
|*3 |*3
{6: }| {102: }|
{1:Error detected while processing pre-vimrc command line:} | {9:Error detected while processing pre-vimrc command line:} |
{1:foo} | {9:foo} |
{7:bar} | {101:bar} |
{8:Press ENTER or type command to continue}^ | {100:Press ENTER or type command to continue}^ |
]]) ]])
end) end)
@ -77,11 +75,11 @@ local function test_embed(ext_linegrid)
screen:expect { screen:expect {
grid = [[ grid = [[
|*3 |*3
{6: }| {102: }|
{1:Error detected while processing pre-vimrc command line:} | {9:Error detected while processing pre-vimrc command line:} |
{1:foo} | {9:foo} |
{1:bar} | {9:bar} |
{2:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]], ]],
condition = function() condition = function()
eq(Screen.colors.Green, screen.default_colors.rgb_bg) eq(Screen.colors.Green, screen.default_colors.rgb_bg)
@ -115,10 +113,6 @@ describe('--embed UI', function()
local screen = Screen.new(40, 8) local screen = Screen.new(40, 8)
screen.rpc_async = true -- Avoid hanging. #24888 screen.rpc_async = true -- Avoid hanging. #24888
screen:attach { stdin_fd = 3 } screen:attach { stdin_fd = 3 }
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true },
}
writer:write 'hello nvim\nfrom external input\n' writer:write 'hello nvim\nfrom external input\n'
writer:shutdown(function() writer:shutdown(function()
@ -139,7 +133,7 @@ describe('--embed UI', function()
^ | ^ |
from external input | from external input |
{1:~ }|*4 {1:~ }|*4
{2:-- INSERT --} | {5:-- INSERT --} |
]] ]]
if not is_os('win') then if not is_os('win') then
@ -173,10 +167,6 @@ describe('--embed UI', function()
local screen = Screen.new(60, 8) local screen = Screen.new(60, 8)
screen.rpc_async = true -- Avoid hanging. #24888 screen.rpc_async = true -- Avoid hanging. #24888
screen:attach { stdin_fd = 3 } screen:attach { stdin_fd = 3 }
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue1 },
[2] = { bold = true },
}
writer:write [[Xbadfile.c:4:12: error: expected ';' before '}' token]] writer:write [[Xbadfile.c:4:12: error: expected ';' before '}' token]]
writer:shutdown(function() writer:shutdown(function()
@ -202,7 +192,7 @@ describe('--embed UI', function()
return 666^ | return 666^ |
} | } |
{1:~ }|*2 {1:~ }|*2
{2:-- INSERT --} | {5:-- INSERT --} |
]] ]]
eq('-', api.nvim_get_option_value('errorfile', {})) eq('-', api.nvim_get_option_value('errorfile', {}))

File diff suppressed because it is too large Load Diff

View File

@ -13,20 +13,9 @@ describe('Signs', function()
clear() clear()
screen = Screen.new() screen = Screen.new()
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[0] = { bold = true, foreground = 255 }, [100] = { bold = true, foreground = Screen.colors.Magenta1 },
[1] = { background = Screen.colors.Yellow }, }
[2] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey },
[3] = { background = Screen.colors.Gray90 },
[4] = { bold = true, reverse = true },
[5] = { reverse = true },
[6] = { foreground = Screen.colors.Brown },
[7] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey },
[8] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[9] = { bold = true, foreground = Screen.colors.Magenta },
[10] = { foreground = Screen.colors.Blue1 },
[11] = { bold = true, foreground = Screen.colors.SeaGreen4 },
})
end) end)
describe(':sign place', function() describe(':sign place', function()
@ -39,10 +28,10 @@ describe('Signs', function()
sign place 2 line=2 name=piet2 buffer=1 sign place 2 line=2 name=piet2 buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{1:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a | {10:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a |
{1:𠜎̀́̂̃̄̅}b | {10:𠜎̀́̂̃̄̅}b |
{2: }^ | {7: }^ |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
end) end)
@ -57,11 +46,11 @@ describe('Signs', function()
sign place 3 line=1 name=pietx buffer=1 sign place 3 line=1 name=pietx buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{1:>!}a | {10:>!}a |
{2: }b | {7: }b |
{1:>>}c | {10:>>}c |
{2: }^ | {7: }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
end) end)
@ -74,7 +63,7 @@ describe('Signs', function()
a | a |
b | b |
^ | ^ |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
end) end)
@ -91,18 +80,18 @@ describe('Signs', function()
sign place 3 line=2 name=piet buffer=1 sign place 3 line=2 name=piet buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{2: }{3:^a }| {7: }{21:^a }|
{1:>>}b | {10:>>}b |
{2: }c | {7: }c |
{2: } | {7: } |
{0:~ }|*2 {1:~ }|*2
{4:[No Name] [+] }| {3:[No Name] [+] }|
{2: }{3:a }| {7: }{21:a }|
{1:>>}b | {10:>>}b |
{2: }c | {7: }c |
{2: } | {7: } |
{0:~ }| {1:~ }|
{5:[No Name] [+] }| {2:[No Name] [+] }|
| |
]]) ]])
end) end)
@ -122,11 +111,11 @@ describe('Signs', function()
sign place 6 line=4 name=pietxx buffer=1 sign place 6 line=4 name=pietxx buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{1:>>}{6: 1 }a | {10:>>}{8: 1 }a |
{2: }{6: 2 }{8:b }| {7: }{8: 2 }{9:b }|
{2: }{7: 3 }c | {7: }{13: 3 }c |
{1:>>}{7: 4 }{8:^ }| {10:>>}{13: 4 }{9:^ }|
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- Check that 'statuscolumn' correctly applies numhl -- Check that 'statuscolumn' correctly applies numhl
@ -144,45 +133,45 @@ describe('Signs', function()
set cursorline set cursorline
]]) ]])
screen:expect([[ screen:expect([[
{1:>>}a | {10:>>}a |
{1:>>}b | {10:>>}b |
{8:>>}{3:^c }| {9:>>}{21:^c }|
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
feed('k') feed('k')
screen:expect([[ screen:expect([[
{1:>>}a | {10:>>}a |
{8:>>}{3:^b }| {9:>>}{21:^b }|
{1:>>}c | {10:>>}c |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
exec('set nocursorline') exec('set nocursorline')
screen:expect([[ screen:expect([[
{1:>>}a | {10:>>}a |
{1:>>}^b | {10:>>}^b |
{1:>>}c | {10:>>}c |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
exec('set cursorline cursorlineopt=line') exec('set cursorline cursorlineopt=line')
screen:expect([[ screen:expect([[
{1:>>}a | {10:>>}a |
{1:>>}{3:^b }| {10:>>}{21:^b }|
{1:>>}c | {10:>>}c |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
exec('set cursorlineopt=number') exec('set cursorlineopt=number')
exec('hi! link SignColumn IncSearch') exec('hi! link SignColumn IncSearch')
feed('Go<esc>2G') feed('Go<esc>2G')
screen:expect([[ screen:expect([[
{1:>>}a | {10:>>}a |
{8:>>}^b | {9:>>}^b |
{1:>>}c | {10:>>}c |
{5: } | {2: } |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726) -- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726)
@ -206,11 +195,11 @@ describe('Signs', function()
-- of signs, the ones with the highest Ids are being picked, -- of signs, the ones with the highest Ids are being picked,
-- and presented by their sorted Id order. -- and presented by their sorted Id order.
screen:expect([[ screen:expect([[
{2: }{6: 1 }a | {7: }{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
WW{1:>>}{6: 3 }c | WW{10:>>}{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
exec([[ exec([[
@ -221,42 +210,42 @@ describe('Signs', function()
sign place 3 line=2 name=pietError buffer=1 sign place 3 line=2 name=pietError buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{8:XX}{1:>>}{6: 1 }a | {9:XX}{10:>>}{8: 1 }a |
{1:>>}{8:XX}{6: 2 }b | {10:>>}{9:XX}{8: 2 }b |
WW{1:>>}{6: 3 }c | WW{10:>>}{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- With the default setting, we get the sign with the top id. -- With the default setting, we get the sign with the top id.
exec('set signcolumn=yes:1') exec('set signcolumn=yes:1')
screen:expect([[ screen:expect([[
{8:XX}{6: 1 }a | {9:XX}{8: 1 }a |
{1:>>}{6: 2 }b | {10:>>}{8: 2 }b |
WW{6: 3 }c | WW{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- "auto:3" accommodates all the signs we defined so far. -- "auto:3" accommodates all the signs we defined so far.
exec('set signcolumn=auto:3') exec('set signcolumn=auto:3')
local s3 = [[ local s3 = [[
{8:XX}{1:>>}{2: }{6: 1 }a | {9:XX}{10:>>}{7: }{8: 1 }a |
{1:>>}{8:XX}{2: }{6: 2 }b | {10:>>}{9:XX}{7: }{8: 2 }b |
WW{1:>>}{8:XX}{6: 3 }c | WW{10:>>}{9:XX}{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]] ]]
screen:expect(s3) screen:expect(s3)
-- Check "yes:9". -- Check "yes:9".
exec('set signcolumn=yes:9') exec('set signcolumn=yes:9')
screen:expect([[ screen:expect([[
{8:XX}{1:>>}{2: }{6: 1 }a | {9:XX}{10:>>}{7: }{8: 1 }a |
{1:>>}{8:XX}{2: }{6: 2 }b | {10:>>}{9:XX}{7: }{8: 2 }b |
WW{1:>>}{8:XX}{2: }{6: 3 }c | WW{10:>>}{9:XX}{7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- Check "auto:N" larger than the maximum number of signs defined in -- Check "auto:N" larger than the maximum number of signs defined in
@ -267,19 +256,19 @@ describe('Signs', function()
exec('3move1') exec('3move1')
exec('2d') exec('2d')
screen:expect([[ screen:expect([[
{8:XX}{1:>>}{6: 1 }a | {9:XX}{10:>>}{8: 1 }a |
{1:>>}{8:XX}{6: 2 }^b | {10:>>}{9:XX}{8: 2 }^b |
{2: }{6: 3 } | {7: }{8: 3 } |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
-- character deletion does not delete signs. -- character deletion does not delete signs.
feed('x') feed('x')
screen:expect([[ screen:expect([[
{8:XX}{1:>>}{6: 1 }a | {9:XX}{10:>>}{8: 1 }a |
{1:>>}{8:XX}{6: 2 }^ | {10:>>}{9:XX}{8: 2 }^ |
{2: }{6: 3 } | {7: }{8: 3 } |
{0:~ }|*10 {1:~ }|*10
| |
]]) ]])
end) end)
@ -290,21 +279,21 @@ describe('Signs', function()
-- sign column should always accommodate at the minimum size -- sign column should always accommodate at the minimum size
exec('set signcolumn=auto:1-3') exec('set signcolumn=auto:1-3')
screen:expect([[ screen:expect([[
{2: }{6: 1 }a | {7: }{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- should support up to 8 signs at minimum -- should support up to 8 signs at minimum
exec('set signcolumn=auto:8-9') exec('set signcolumn=auto:8-9')
screen:expect([[ screen:expect([[
{2: }{6: 1 }a | {7: }{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- should keep the same sign size when signs are not exceeding -- should keep the same sign size when signs are not exceeding
@ -313,11 +302,11 @@ describe('Signs', function()
exec('sign define pietSearch text=>> texthl=Search') exec('sign define pietSearch text=>> texthl=Search')
exec('sign place 1 line=1 name=pietSearch buffer=1') exec('sign place 1 line=1 name=pietSearch buffer=1')
screen:expect([[ screen:expect([[
{1:>>}{2: }{6: 1 }a | {10:>>}{7: }{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- should resize itself when signs are exceeding minimum but -- should resize itself when signs are exceeding minimum but
@ -328,11 +317,11 @@ describe('Signs', function()
sign place 4 line=1 name=pietSearch buffer=1 sign place 4 line=1 name=pietSearch buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{1:>>>>>>>>}{6: 1 }a | {10:>>>>>>>>}{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- should not increase size because sign with existing id is moved -- should not increase size because sign with existing id is moved
@ -340,11 +329,11 @@ describe('Signs', function()
screen:expect_unchanged() screen:expect_unchanged()
exec('sign unplace 4') exec('sign unplace 4')
screen:expect([[ screen:expect([[
{1:>>>>>>}{6: 1 }a | {10:>>>>>>}{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
exec('sign place 4 line=1 name=pietSearch buffer=1') exec('sign place 4 line=1 name=pietSearch buffer=1')
@ -357,11 +346,11 @@ describe('Signs', function()
sign place 8 line=1 name=pietSearch buffer=1 sign place 8 line=1 name=pietSearch buffer=1
]]) ]])
screen:expect([[ screen:expect([[
{1:>>>>>>>>>>}{6: 1 }a | {10:>>>>>>>>>>}{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
end) end)
@ -377,21 +366,21 @@ describe('Signs', function()
]]) ]])
-- no signcolumn with only empty sign -- no signcolumn with only empty sign
screen:expect([[ screen:expect([[
{6: 1 }a | {8: 1 }a |
{6: 2 }b | {8: 2 }b |
{6: 3 }c | {8: 3 }c |
{6: 4 }^ | {8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- single column with 1 sign with text and one sign without -- single column with 1 sign with text and one sign without
exec('sign place 1 line=1 name=pietSearch buffer=1') exec('sign place 1 line=1 name=pietSearch buffer=1')
screen:expect([[ screen:expect([[
{1:>>}{6: 1 }a | {10:>>}{8: 1 }a |
{2: }{6: 2 }b | {7: }{8: 2 }b |
{2: }{6: 3 }c | {7: }{8: 3 }c |
{2: }{6: 4 }^ | {7: }{8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
end) end)
@ -408,23 +397,23 @@ describe('Signs', function()
-- line number should be drawn if sign has no text -- line number should be drawn if sign has no text
-- no signcolumn, line number for "a" is Search, for "b" is Error, for "c" is LineNr -- no signcolumn, line number for "a" is Search, for "b" is Error, for "c" is LineNr
screen:expect([[ screen:expect([[
{1: >> }a | {10: >> }a |
{8: 2 }b | {9: 2 }b |
{6: 3 }c | {8: 3 }c |
{6: 4 }^ | {8: 4 }^ |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
-- number column on wrapped part of a line should be empty -- number column on wrapped part of a line should be empty
feed('gg100aa<Esc>') feed('gg100aa<Esc>')
screen:expect([[ screen:expect([[
{1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {10: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {9: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{8: }aa^a | {9: }aa^a |
{8: 2 }b | {9: 2 }b |
{6: 3 }c | {8: 3 }c |
{6: 4 } | {8: 4 } |
{0:~ }|*7 {1:~ }|*7
| |
]]) ]])
api.nvim_buf_set_extmark(0, api.nvim_create_namespace('test'), 0, 0, { api.nvim_buf_set_extmark(0, api.nvim_create_namespace('test'), 0, 0, {
@ -434,14 +423,14 @@ describe('Signs', function()
feed('<C-Y>') feed('<C-Y>')
-- number column on virtual lines should be empty -- number column on virtual lines should be empty
screen:expect([[ screen:expect([[
{6: }VIRT LINES | {8: }VIRT LINES |
{1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {10: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {9: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{8: }aa^a | {9: }aa^a |
{8: 2 }b | {9: 2 }b |
{6: 3 }c | {8: 3 }c |
{6: 4 } | {8: 4 } |
{0:~ }|*6 {1:~ }|*6
| |
]]) ]])
end) end)
@ -451,21 +440,21 @@ describe('Signs', function()
exec('sign place 100000 line=1 name=piet buffer=1') exec('sign place 100000 line=1 name=piet buffer=1')
feed(':sign place<cr>') feed(':sign place<cr>')
screen:expect([[ screen:expect([[
{1:>>} | {10:>>} |
{0:~ }|*6 {1:~ }|*6
{4: }| {3: }|
:sign place | :sign place |
{9:--- Signs ---} | {100:--- Signs ---} |
{10:Signs for [NULL]:} | {18:Signs for [NULL]:} |
line=1 id=100000 name=piet priority=10 | line=1 id=100000 name=piet priority=10 |
| |
{11:Press ENTER or type command to continue}^ | {6:Press ENTER or type command to continue}^ |
]]) ]])
feed('<cr>') feed('<cr>')
screen:expect([[ screen:expect([[
{1:>>}^ | {10:>>}^ |
{0:~ }|*12 {1:~ }|*12
| |
]]) ]])
end) end)
@ -479,11 +468,11 @@ describe('Signs', function()
exec('2delete') exec('2delete')
exec('sign unplace 10001') exec('sign unplace 10001')
screen:expect([[ screen:expect([[
{2: }a | {7: }a |
{2: }^c | {7: }^c |
{2: }d | {7: }d |
>>e | >>e |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
exec('sign unplace 10002') exec('sign unplace 10002')
@ -492,7 +481,7 @@ describe('Signs', function()
^c | ^c |
d | d |
e | e |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
end) end)
@ -505,13 +494,13 @@ describe('Signs', function()
exec('copy .') exec('copy .')
exec('sign unplace 10001') exec('sign unplace 10001')
screen:expect([[ screen:expect([[
{2: }a | {7: }a |
{2: }^a | {7: }^a |
{2: }b | {7: }b |
{2: }c | {7: }c |
{2: }d | {7: }d |
>>e | >>e |
{0:~ }|*7 {1:~ }|*7
| |
]]) ]])
exec('sign unplace 10002') exec('sign unplace 10002')
@ -522,7 +511,7 @@ describe('Signs', function()
c | c |
d | d |
e | e |
{0:~ }|*7 {1:~ }|*7
| |
]]) ]])
end) end)
@ -537,9 +526,9 @@ describe('Signs', function()
call sign_place(0, '', 'foo', bufnr(''), { 'lnum':2 }) call sign_place(0, '', 'foo', bufnr(''), { 'lnum':2 })
]]) ]])
screen:expect([[ screen:expect([[
{8: 1 }^line1 | {9: 1 }^line1 |
{8: 2 }line2 | {9: 2 }line2 |
{6: 3 }line3 | {8: 3 }line3 |
| |
]]) ]])
end) end)
@ -561,11 +550,11 @@ describe('Signs', function()
exec('norm 2Gdd') exec('norm 2Gdd')
exec('silent undo') exec('silent undo')
screen:expect([[ screen:expect([[
{2: }1 | {7: }1 |
S1^2 | S1^2 |
{2: }3 | {7: }3 |
{2: }4 | {7: }4 |
{0:~ }|*9 {1:~ }|*9
| |
]]) ]])
end) end)
@ -590,7 +579,7 @@ describe('Signs', function()
local s1 = { local s1 = {
grid = [[ grid = [[
S2^ | S2^ |
{0:~ }|*12 {1:~ }|*12
| |
]], ]],
} }
@ -600,7 +589,7 @@ describe('Signs', function()
screen:expect({ screen:expect({
grid = [[ grid = [[
S2S1^ | S2S1^ |
{0:~ }|*12 {1:~ }|*12
| |
]], ]],
}) })

View File

@ -235,30 +235,24 @@ describe('statuscolumn', function()
it('works with wrapped lines, signs and folds', function() it('works with wrapped lines, signs and folds', function()
command([[set stc=%C%s%=%{v:virtnum?'':v:lnum}│\ ]]) command([[set stc=%C%s%=%{v:virtnum?'':v:lnum}│\ ]])
command("call setline(1,repeat([repeat('aaaaa',10)],16))") command("call setline(1,repeat([repeat('aaaaa',10)],16))")
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[0] = { bold = true, foreground = Screen.colors.Blue }, [100] = { foreground = Screen.colors.Red, background = Screen.colors.LightGray },
[1] = { foreground = Screen.colors.Brown }, }
[2] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGrey },
[3] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey },
[4] = { bold = true, foreground = Screen.colors.Brown },
[5] = { foreground = Screen.colors.Red },
[6] = { foreground = Screen.colors.Red, background = Screen.colors.LightGrey },
})
command('hi! CursorLine guifg=Red guibg=NONE') command('hi! CursorLine guifg=Red guibg=NONE')
screen:expect([[ screen:expect([[
{1: 4 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 4 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1: 5 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 5 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1: 6 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 6 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1: 7 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 7 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1: 8 }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 8 }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1: 9 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8: 9 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1: }a | {8: }a |
{1:10 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}| {8:10 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:@@@}|
| |
]]) ]])
command([[set stc=%C%s%=%l│\ ]]) command([[set stc=%C%s%=%l│\ ]])
@ -271,108 +265,108 @@ describe('statuscolumn', function()
command('sign place 3 line=6 name=piet1 buffer=1') command('sign place 3 line=6 name=piet1 buffer=1')
command('sign place 4 line=6 name=piet2 buffer=1') command('sign place 4 line=6 name=piet2 buffer=1')
screen:expect([[ screen:expect([[
{1:>>}{2: }{1: 4 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:>>}{7: }{8: 4 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{0:>!}{2: }{1: 5 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {1:>!}{7: }{8: 5 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{0:>!}{1:>> 6 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {1:>!}{8:>> 6 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{2: }{1: 7 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 7 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{2: }{1: 8 }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 8 }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{2: }{1: 9 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 9 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }aaaaa | {7: }{8: }aaaaa |
{2: }{1:10 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}| {7: }{8:10 }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:@@@}|
| |
]]) ]])
command('norm zf$') command('norm zf$')
-- Check that alignment works properly with signs after %= -- Check that alignment works properly with signs after %=
command([[set stc=%C%=%{v:virtnum?'':v:lnum}│%s\ ]]) command([[set stc=%C%=%{v:virtnum?'':v:lnum}│%s\ ]])
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 5}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 5}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 6}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 6}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 7}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 7}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2:+}{1: 8}{2: }{1: }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7:+}{8: 8}{7: }{8: }{13:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{1: 9}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 9}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1:10}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8:10}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
| |
]]) ]])
command('set cursorline') command('set cursorline')
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 5}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 5}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 6}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 6}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1: 7}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 7}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2:+}{4: 8}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7:+}{15: 8}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{1: 9}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 9}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
{2: }{1:10}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8:10}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaa | {7: }{8: }{7: }{8: }aaaaaa |
| |
]]) ]])
-- v:lnum is the same value on wrapped lines -- v:lnum is the same value on wrapped lines
command([[set stc=%C%=%{v:lnum}│%s\ ]]) command([[set stc=%C%=%{v:lnum}│%s\ ]])
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 4}{2: }{1: }aaaaaa | {7: }{8: 4}{7: }{8: }aaaaaa |
{2: }{1: 5}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 5}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 5}{2: }{1: }aaaaaa | {7: }{8: 5}{7: }{8: }aaaaaa |
{2: }{1: 6}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 6}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 6}{2: }{1: }aaaaaa | {7: }{8: 6}{7: }{8: }aaaaaa |
{2: }{1: 7}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 7}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 7}{2: }{1: }aaaaaa | {7: }{8: 7}{7: }{8: }aaaaaa |
{2:+}{4: 8}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7:+}{15: 8}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{1: 9}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 9}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 9}{2: }{1: }aaaaaa | {7: }{8: 9}{7: }{8: }aaaaaa |
{2: }{1:10}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8:10}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1:10}{2: }{1: }aaaaaa | {7: }{8:10}{7: }{8: }aaaaaa |
| |
]]) ]])
-- v:relnum is the same value on wrapped lines -- v:relnum is the same value on wrapped lines
command([[set stc=%C%=\ %{v:relnum}│%s\ ]]) command([[set stc=%C%=\ %{v:relnum}│%s\ ]])
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 4}{2: }{1: }aaaaaaa | {7: }{8: 4}{7: }{8: }aaaaaaa |
{2: }{1: 3}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 3}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 3}{2: }{1: }aaaaaaa | {7: }{8: 3}{7: }{8: }aaaaaaa |
{2: }{1: 2}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 2}{2: }{1: }aaaaaaa | {7: }{8: 2}{7: }{8: }aaaaaaa |
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 1}{2: }{1: }aaaaaaa | {7: }{8: 1}{7: }{8: }aaaaaaa |
{2:+}{4: 0}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7:+}{15: 0}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 1}{2: }{1: }aaaaaaa | {7: }{8: 1}{7: }{8: }aaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: 2}{2: }{1: }aaaaaaa | {7: }{8: 2}{7: }{8: }aaaaaaa |
| |
]]) ]])
command([[set stc=%C%=\ %{v:virtnum?'':v:relnum}│%s\ ]]) command([[set stc=%C%=\ %{v:virtnum?'':v:relnum}│%s\ ]])
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
{2: }{1: 3}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 3}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
{2: }{1: 2}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
{2:+}{4: 0}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7:+}{15: 0}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaa | {7: }{8: }{7: }{8: }aaaaaaa |
| |
]]) ]])
-- Up to 9 signs in a line -- Up to 9 signs in a line
@ -385,75 +379,75 @@ describe('statuscolumn', function()
command('sign place 10 line=6 name=piet2 buffer=1') command('sign place 10 line=6 name=piet2 buffer=1')
command('sign place 11 line=6 name=piet1 buffer=1') command('sign place 11 line=6 name=piet1 buffer=1')
screen:expect([[ screen:expect([[
{2: }{1: 4>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 3}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 3}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
{2:+}{4: 0}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaa}| {7:+}{15: 0}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaa}|
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }{1: }{2: }{1: }aaaaaaaaaaaaaaaaaaaaa | {7: }{8: }{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
| |
]]) ]])
-- Also test fold and sign column when 'cpoptions' includes "n" -- Also test fold and sign column when 'cpoptions' includes "n"
command('set cpoptions+=n') command('set cpoptions+=n')
feed('Hgjg0') feed('Hgjg0')
screen:expect([[ screen:expect([[
{2: }{4: 0}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7: }{15: 0}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{5:^aaaaaaaaaaaaaaaaaaaaa }| {7: }{19:^aaaaaaaaaaaaaaaaaaaaa }|
{2: }{1: 3}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 3}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2:+}{1: 4}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}| {7:+}{8: 4}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
{2: }{1: 1}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
| |
]]) ]])
command('set breakindent') command('set breakindent')
command('sign unplace 2') command('sign unplace 2')
feed('J2gjg0') feed('J2gjg0')
screen:expect([[ screen:expect([[
{2: }{4: 0}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7: }{15: 0}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: } {5:aaaaaaaaaaaaaaaaaaaaa aaaaaaa}| {7: } {19:aaaaaaaaaaaaaaaaaaaaa aaaaaaa}|
{2: } {5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7: } {19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: } {5:^aaaaaaaaaaaaaa }| {7: } {19:^aaaaaaaaaaaaaa }|
{2: }{1: 1>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: } aaaaaaaaaaaaaaaaaaaaa | {7: } aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: } aaaaaaaaaaaaaaaaaaaaa | {7: } aaaaaaaaaaaaaaaaaaaaa |
{2:+}{1: 3}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}| {7:+}{8: 3}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
{2: }{1: 4}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: } aaaaaaaaaaaaaaaaaaaaa | {7: } aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 5}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 5}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: } aaaaaaaaaaaaaaaaaaaaa | {7: } aaaaaaaaaaaaaaaaaaaaa |
| |
]]) ]])
command('set nobreakindent') command('set nobreakindent')
feed('$g0') feed('$g0')
screen:expect([[ screen:expect([[
{2: }{4: 0}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7: }{15: 0}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{5:aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa}| {7: }{19:aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa}|
{2: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {7: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{2: }{5:^aaaa }| {7: }{19:^aaaa }|
{2: }{1: 1>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 1>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 2}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 2}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2:+}{1: 3}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}| {7:+}{8: 3}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
{2: }{1: 4}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 4}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
{2: }{1: 5}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {7: }{8: 5}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{2: }aaaaaaaaaaaaaaaaaaaaa | {7: }aaaaaaaaaaaaaaaaaaaaa |
| |
]]) ]])
command('silent undo') command('silent undo')
@ -467,38 +461,38 @@ describe('statuscolumn', function()
]]) ]])
command('set foldcolumn=0 signcolumn=number stc=%l') command('set foldcolumn=0 signcolumn=number stc=%l')
screen:expect([[ screen:expect([[
{1:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1: 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8: 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1: }virt_line | {8: }virt_line |
{1: }virt_line above | {8: }virt_line above |
{1:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1: 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8: 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{4: 8}{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {15: 8}{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{1: 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8: 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1:10}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:10}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1:11}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:11}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1:12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1:13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
{1:14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | {8:14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
| |
]]) ]])
command( command(
[[set stc=%{v:virtnum<0?'virtual':(!v:virtnum?'buffer':'wrapped')}%=%{'\ '.v:virtnum.'\ '.v:lnum}]] [[set stc=%{v:virtnum<0?'virtual':(!v:virtnum?'buffer':'wrapped')}%=%{'\ '.v:virtnum.'\ '.v:lnum}]]
) )
screen:expect([[ screen:expect([[
{1:buffer 0 4}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 4}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 4}aaaaaaaa | {8:wrapped 1 4}aaaaaaaa |
{1:buffer 0 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 5}aaaaaaaa | {8:wrapped 1 5}aaaaaaaa |
{1:virtual-2 5}virt_line | {8:virtual-2 5}virt_line |
{1:virtual-1 5}virt_line above | {8:virtual-1 5}virt_line above |
{1:buffer 0 6}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 6}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 6}aaaaaaaa | {8:wrapped 1 6}aaaaaaaa |
{1:buffer 0 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 7}aaaaaaaa | {8:wrapped 1 7}aaaaaaaa |
{4:buffer 0 8}{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {15:buffer 0 8}{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{1:buffer 0 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 9}aaaaaaaa | {8:wrapped 1 9}aaaaaaaa |
| |
]]) ]])
-- Also test virt_lines at the end of buffer -- Also test virt_lines at the end of buffer
@ -507,17 +501,17 @@ describe('statuscolumn', function()
]]) ]])
feed('GkJzz') feed('GkJzz')
screen:expect([[ screen:expect([[
{1:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 12}aaaaaaaaa | {8:wrapped 1 12}aaaaaaaaa |
{1:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 13}aaaaaaaaa | {8:wrapped 1 13}aaaaaaaaa |
{1:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 14}aaaaaaaaa | {8:wrapped 1 14}aaaaaaaaa |
{4:buffer 0 15}{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {15:buffer 0 15}{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{4:wrapped 1 15}{5:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {15:wrapped 1 15}{19:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{4:wrapped 2 15}{5:aaaaaaaaaaaaaaaaaaa }| {15:wrapped 2 15}{19:aaaaaaaaaaaaaaaaaaa }|
{1:virtual-1 15}END | {8:virtual-1 15}END |
{0:~ }|*3 {1:~ }|*3
| |
]]) ]])
-- Also test virt_lines when 'cpoptions' includes "n" -- Also test virt_lines when 'cpoptions' includes "n"
@ -527,19 +521,19 @@ describe('statuscolumn', function()
vim.api.nvim_buf_set_extmark(0, ns, 14, 0, { virt_lines = {{{"virt_line2", ""}}} }) vim.api.nvim_buf_set_extmark(0, ns, 14, 0, { virt_lines = {{{"virt_line2", ""}}} })
]]) ]])
screen:expect([[ screen:expect([[
{1:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa | aaaaaaaaa |
{1:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa | aaaaaaaaa |
{1:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa | aaaaaaaaa |
{4:buffer 0 15}{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {15:buffer 0 15}{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{5:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| {19:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
{5:aaaaaaa }| {19:aaaaaaa }|
{1:virtual-3 15}virt_line1 | {8:virtual-3 15}virt_line1 |
{1:virtual-2 15}virt_line2 | {8:virtual-2 15}virt_line2 |
{1:virtual-1 15}END | {8:virtual-1 15}END |
{0:~ }| {1:~ }|
| |
]]) ]])
-- Also test "col_rows" code path for 'relativenumber' cursor movement -- Also test "col_rows" code path for 'relativenumber' cursor movement
@ -548,36 +542,36 @@ describe('statuscolumn', function()
set stc=%{v:virtnum<0?'virtual':(!v:virtnum?'buffer':'wrapped')}%=%{'\ '.v:virtnum.'\ '.v:lnum.'\ '.v:relnum} set stc=%{v:virtnum<0?'virtual':(!v:virtnum?'buffer':'wrapped')}%=%{'\ '.v:virtnum.'\ '.v:lnum.'\ '.v:relnum}
]]) ]])
screen:expect([[ screen:expect([[
{1:buffer 0 12 3}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 12 3}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 12 3}aaaaaaaaaaa | {8:wrapped 1 12 3}aaaaaaaaaaa |
{1:buffer 0 13 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 13 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 13 2}aaaaaaaaaaa | {8:wrapped 1 13 2}aaaaaaaaaaa |
{1:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 14 1}aaaaaaaaaaa | {8:wrapped 1 14 1}aaaaaaaaaaa |
{1:buffer 0 15 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 15 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 15 0}aaaaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:wrapped 1 15 0}aaaaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 2 15 0}aaaaaaaaaaaaaaaaaaaaaaa | {8:wrapped 2 15 0}aaaaaaaaaaaaaaaaaaaaaaa |
{1:virtual-3 15 0}virt_line1 | {8:virtual-3 15 0}virt_line1 |
{1:virtual-2 15 0}virt_line2 | {8:virtual-2 15 0}virt_line2 |
{1:virtual-1 15 0}END | {8:virtual-1 15 0}END |
{0:~ }| {1:~ }|
| |
]]) ]])
feed('kk') feed('kk')
screen:expect([[ screen:expect([[
{1:buffer 0 12 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 12 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 12 1}aaaaaaaaaaa | {8:wrapped 1 12 1}aaaaaaaaaaa |
{1:buffer 0 13 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 13 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 13 0}aaaaaaaaaa^a | {8:wrapped 1 13 0}aaaaaaaaaa^a |
{1:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 14 1}aaaaaaaaaaa | {8:wrapped 1 14 1}aaaaaaaaaaa |
{1:buffer 0 15 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:buffer 0 15 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 1 15 2}aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa| {8:wrapped 1 15 2}aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:wrapped 2 15 2}aaaaaaaaaaaaaaaaaaaaaaa | {8:wrapped 2 15 2}aaaaaaaaaaaaaaaaaaaaaaa |
{1:virtual-3 15 2}virt_line1 | {8:virtual-3 15 2}virt_line1 |
{1:virtual-2 15 2}virt_line2 | {8:virtual-2 15 2}virt_line2 |
{1:virtual-1 15 2}END | {8:virtual-1 15 2}END |
{0:~ }| {1:~ }|
| |
]]) ]])
end) end)
@ -680,10 +674,6 @@ describe('statuscolumn', function()
it('popupmenu callback does not drag mouse on close', function() it('popupmenu callback does not drag mouse on close', function()
screen:try_resize(screen._width, 2) screen:try_resize(screen._width, 2)
screen:set_default_attr_ids({
[0] = { foreground = Screen.colors.Brown },
[1] = { background = Screen.colors.Plum1 },
})
api.nvim_set_option_value('statuscolumn', '%0@MyClickFunc@%l%T', {}) api.nvim_set_option_value('statuscolumn', '%0@MyClickFunc@%l%T', {})
exec([[ exec([[
function! MyClickFunc(minwid, clicks, button, mods) function! MyClickFunc(minwid, clicks, button, mods)
@ -695,26 +685,26 @@ describe('statuscolumn', function()
-- clicking an item does not drag mouse -- clicking an item does not drag mouse
api.nvim_input_mouse('left', 'press', '', 0, 0, 0) api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[ screen:expect([[
{0: 8}^aaaaa | {8: 8}^aaaaa |
{1: Echo } | {4: Echo } |
]]) ]])
api.nvim_input_mouse('left', 'press', '', 0, 1, 5) api.nvim_input_mouse('left', 'press', '', 0, 1, 5)
api.nvim_input_mouse('left', 'release', '', 0, 1, 5) api.nvim_input_mouse('left', 'release', '', 0, 1, 5)
screen:expect([[ screen:expect([[
{0: 8}^aaaaa | {8: 8}^aaaaa |
0 1 l 8 | 0 1 l 8 |
]]) ]])
command('echo') command('echo')
-- clicking outside to close the menu does not drag mouse -- clicking outside to close the menu does not drag mouse
api.nvim_input_mouse('left', 'press', '', 0, 0, 0) api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[ screen:expect([[
{0: 8}^aaaaa | {8: 8}^aaaaa |
{1: Echo } | {4: Echo } |
]]) ]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 10) api.nvim_input_mouse('left', 'press', '', 0, 0, 10)
api.nvim_input_mouse('left', 'release', '', 0, 0, 10) api.nvim_input_mouse('left', 'release', '', 0, 0, 10)
screen:expect([[ screen:expect([[
{0: 8}^aaaaa | {8: 8}^aaaaa |
| |
]]) ]])
end) end)
@ -943,16 +933,15 @@ describe('statuscolumn', function()
it('does not wrap multibyte characters at the end of a line', function() it('does not wrap multibyte characters at the end of a line', function()
screen:try_resize(33, 4) screen:try_resize(33, 4)
screen:set_default_attr_ids { screen:add_extra_attr_ids {
[8] = { foreground = Screen.colors.Brown }, [100] = { undercurl = true, special = Screen.colors.Red },
[31] = { undercurl = true, special = Screen.colors.Red },
} }
command([[set spell stc=%l\ ]]) command([[set spell stc=%l\ ]])
command('call setline(8, "This is a line that contains ᶏ multibyte character.")') command('call setline(8, "This is a line that contains ᶏ multibyte character.")')
screen:expect([[ screen:expect([[
{8: 8 }^This is a line that contains {31:}| {8: 8 }^This is a line that contains {100:}|
{8: } {31:multibyte} character. | {8: } {100:multibyte} character. |
{8: 9 }{31:aaaaa} | {8: 9 }{100:aaaaa} |
| |
]]) ]])
end) end)

View File

@ -24,11 +24,9 @@ for _, model in ipairs(mousemodels) do
before_each(function() before_each(function()
clear() clear()
screen = Screen.new(40, 8) screen = Screen.new(40, 8)
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [100] = { bold = true, reverse = true, foreground = Screen.colors.Blue },
[1] = { bold = true, reverse = true }, -- StatusLine }
[2] = { bold = true, foreground = Screen.colors.Blue, reverse = true }, -- NonText combined with StatusLine
})
screen:attach() screen:attach()
command('set laststatus=2 mousemodel=' .. model) command('set laststatus=2 mousemodel=' .. model)
exec([=[ exec([=[
@ -87,8 +85,8 @@ for _, model in ipairs(mousemodels) do
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
{0:~ }|*5 {1:~ }|*5
{1:^I}{2:^A^I^A^I}{1:^A }| {3:^I}{100:^A^I^A^I}{3:^A }|
| |
]], ]],
} }
@ -211,8 +209,8 @@ for _, model in ipairs(mousemodels) do
screen:expect { screen:expect {
grid = [[ grid = [[
^ | ^ |
{0:~ }{0:~ }|*5 {1:~ }{1:~ }|*5
{1:Clicky stuff Clicky stuff}| {3:Clicky stuff Clicky stuff}|
| |
]], ]],
} }
@ -257,13 +255,9 @@ describe('global statusline', function()
clear() clear()
screen = Screen.new(60, 16) screen = Screen.new(60, 16)
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:add_extra_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue }, [100] = { foreground = Screen.colors.Magenta1, bold = true },
[2] = { bold = true, reverse = true }, }
[3] = { bold = true },
[4] = { reverse = true },
[5] = { bold = true, foreground = Screen.colors.Fuchsia },
})
command('set laststatus=3') command('set laststatus=3')
command('set ruler') command('set ruler')
end) end)
@ -272,7 +266,7 @@ describe('global statusline', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }|*13 {1:~ }|*13
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
@ -281,8 +275,8 @@ describe('global statusline', function()
|*2 |*2
^ | ^ |
{1:~ }|*11 {1:~ }|*11
{2:[No Name] [+] 3,1 All}| {3:[No Name] [+] 3,1 All}|
{3:-- INSERT --} | {5:-- INSERT --} |
]]) ]])
end) end)
@ -299,7 +293,7 @@ describe('global statusline', function()
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }{1:~ }|*3 {1:~ }{1:~ }|*3
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
end) end)
@ -316,7 +310,7 @@ describe('global statusline', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }|*13 {1:~ }|*13
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
@ -325,15 +319,15 @@ describe('global statusline', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }{1:~}{1:~ }|*3 {1:~ }{1:~ }{1:~}{1:~ }|*3
{1:~ }{4:< Name] 0,0-1 }{1:~}{1:~ }| {1:~ }{2:< Name] 0,0-1 }{1:~}{1:~ }|
{1:~ } {1:~}{1:~ }| {1:~ } {1:~}{1:~ }|
{1:~ }{1:~ }{1:~}{1:~ }| {1:~ }{1:~ }{1:~}{1:~ }|
{1:~ }{1:~ }{1:~}{2:<No Name] 0,0-1 All}| {1:~ }{1:~ }{1:~}{3:<No Name] 0,0-1 All}|
{1:~ }{1:~ }{1:~} | {1:~ }{1:~ }{1:~} |
{4:<No Name] 0,0-1 All < Name] 0,0-1 <}{1:~ }| {2:<No Name] 0,0-1 All < Name] 0,0-1 <}{1:~ }|
{1:~ }| {1:~ }|
{1:~ }{1:~ }|*3 {1:~ }{1:~ }|*3
{4:[No Name] 0,0-1 All <No Name] 0,0-1 All}| {2:[No Name] 0,0-1 All <No Name] 0,0-1 All}|
| |
]]) ]])
@ -349,7 +343,7 @@ describe('global statusline', function()
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }{1:~ }|*3 {1:~ }{1:~ }|*3
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
@ -357,12 +351,12 @@ describe('global statusline', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }{1:~}{1:~ }|*3 {1:~ }{1:~ }{1:~}{1:~ }|*3
{1:~ }{4:< Name] 0,0-1 }{1:~}{1:~ }| {1:~ }{2:< Name] 0,0-1 }{1:~}{1:~ }|
{1:~ } {1:~}{1:~ }| {1:~ } {1:~}{1:~ }|
{1:~ }{1:~ }{1:~}{1:~ }| {1:~ }{1:~ }{1:~}{1:~ }|
{1:~ }{1:~ }{1:~}{2:<No Name] 0,0-1 All}| {1:~ }{1:~ }{1:~}{3:<No Name] 0,0-1 All}|
{1:~ }{1:~ }{1:~} | {1:~ }{1:~ }{1:~} |
{4:<No Name] 0,0-1 All < Name] 0,0-1 <}{1:~ }| {2:<No Name] 0,0-1 All < Name] 0,0-1 <}{1:~ }|
{1:~ }| {1:~ }|
{1:~ }{1:~ }|*4 {1:~ }{1:~ }|*4
0,0-1 All | 0,0-1 All |
@ -380,7 +374,7 @@ describe('global statusline', function()
{1:~ }| {1:~ }|
{1:~ }| {1:~ }|
{1:~ }{1:~ }|*3 {1:~ }{1:~ }|*3
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
end) end)
@ -430,7 +424,7 @@ describe('global statusline', function()
0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSION;;;; | 0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSION;;;; |
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; | 0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
^0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; | ^0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
{2:test/functional/fixtures/bigfile.txt 7,1 Top}| {3:test/functional/fixtures/bigfile.txt 7,1 Top}|
| |
]]) ]])
feed('j') feed('j')
@ -445,12 +439,12 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; | 0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; | 0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; | ^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
{2:test/functional/fixtures/bigfile.txt 8,1 0%}| {3:test/functional/fixtures/bigfile.txt 8,1 0%}|
| |
]]) ]])
api.nvim_set_option_value('showtabline', 2, {}) api.nvim_set_option_value('showtabline', 2, {})
screen:expect([[ screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }| {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
| |
{1:~ }|*5 {1:~ }|*5
| |
@ -460,12 +454,12 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; | 0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; | 0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; | ^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
{2:test/functional/fixtures/bigfile.txt 8,1 0%}| {3:test/functional/fixtures/bigfile.txt 8,1 0%}|
| |
]]) ]])
api.nvim_set_option_value('cmdheight', 0, {}) api.nvim_set_option_value('cmdheight', 0, {})
screen:expect([[ screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }| {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
| |
{1:~ }|*5 {1:~ }|*5
| |
@ -476,11 +470,11 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; | 0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; | 0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; | ^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
{2:test/functional/fixtures/bigfile.txt 8,1 0%}| {3:test/functional/fixtures/bigfile.txt 8,1 0%}|
]]) ]])
api.nvim_set_option_value('cmdheight', 1, {}) api.nvim_set_option_value('cmdheight', 1, {})
screen:expect([[ screen:expect([[
{3: }{5:2}{3: t/f/f/bigfile.txt }{4: }| {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
| |
{1:~ }|*5 {1:~ }|*5
| |
@ -490,7 +484,7 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; | 0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; | 0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; | ^0007;<control>;Cc;0;BN;;;;;N;BELL;;;; |
{2:test/functional/fixtures/bigfile.txt 8,1 0%}| {3:test/functional/fixtures/bigfile.txt 8,1 0%}|
| |
]]) ]])
end) end)
@ -509,7 +503,7 @@ describe('global statusline', function()
| |
^ | ^ |
{1:~ }|*6 {1:~ }|*6
{2:[No Name] 0,0-1 All}| {3:[No Name] 0,0-1 All}|
| |
]]) ]])
end) end)
@ -526,10 +520,6 @@ end)
it('statusline is redrawn with :resize from <Cmd> mapping #19629', function() it('statusline is redrawn with :resize from <Cmd> mapping #19629', function()
clear() clear()
local screen = Screen.new(40, 8) local screen = Screen.new(40, 8)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { bold = true, reverse = true }, -- StatusLine
})
screen:attach() screen:attach()
exec([[ exec([[
set laststatus=2 set laststatus=2
@ -539,15 +529,15 @@ it('statusline is redrawn with :resize from <Cmd> mapping #19629', function()
feed('<Up>') feed('<Up>')
screen:expect([[ screen:expect([[
^ | ^ |
{0:~ }|*4 {1:~ }|*4
{1:[No Name] }| {3:[No Name] }|
|*2 |*2
]]) ]])
feed('<Down>') feed('<Down>')
screen:expect([[ screen:expect([[
^ | ^ |
{0:~ }|*5 {1:~ }|*5
{1:[No Name] }| {3:[No Name] }|
| |
]]) ]])
end) end)
@ -555,19 +545,14 @@ end)
it('showcmdloc=statusline does not show if statusline is too narrow', function() it('showcmdloc=statusline does not show if statusline is too narrow', function()
clear() clear()
local screen = Screen.new(40, 8) local screen = Screen.new(40, 8)
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { bold = true, reverse = true }, -- StatusLine
[2] = { reverse = true }, -- StatusLineNC
})
screen:attach() screen:attach()
command('set showcmd') command('set showcmd')
command('set showcmdloc=statusline') command('set showcmdloc=statusline')
command('1vsplit') command('1vsplit')
screen:expect([[ screen:expect([[
^ | ^ |
{0:~}{0:~ }|*5 {1:~}{1:~ }|*5
{1:< }{2:[No Name] }| {3:< }{2:[No Name] }|
| |
]]) ]])
feed('1234') feed('1234')
@ -692,11 +677,6 @@ end)
it('shows correct ruler in cmdline with no statusline', function() it('shows correct ruler in cmdline with no statusline', function()
clear() clear()
local screen = Screen.new(30, 8) local screen = Screen.new(30, 8)
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[2] = { bold = true, reverse = true }, -- StatusLine
[3] = { reverse = true }, -- StatusLineNC
}
screen:attach() screen:attach()
-- Use long ruler to check 'ruler' with 'rulerformat' set has correct width. -- Use long ruler to check 'ruler' with 'rulerformat' set has correct width.
command [[ command [[
@ -714,7 +694,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[ screen:expect [[
^ | ^ |
{1:~ }|*2 {1:~ }|*2
{2:[No Name] 1longlonglong }| {3:[No Name] 1longlonglong }|
| |
{1:~ }{1:~ }|*2 {1:~ }{1:~ }|*2
3longlonglong | 3longlonglong |
@ -725,7 +705,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[ screen:expect [[
| |
{1:~ }|*2 {1:~ }|*2
{3:[No Name] 1longlonglong }| {2:[No Name] 1longlonglong }|
^ | ^ |
{1:~ }{1:~ }|*2 {1:~ }{1:~ }|*2
2longlonglong | 2longlonglong |
@ -735,7 +715,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[ screen:expect [[
| |
{1:~ }|*2 {1:~ }|*2
{3:[No Name] 1longlonglong }| {2:[No Name] 1longlonglong }|
^ | ^ |
{1:~ }{1:~ }|*2 {1:~ }{1:~ }|*2
3longlonglong | 3longlonglong |
@ -746,9 +726,6 @@ it('uses "stl" and "stlnc" fillchars even if they are the same #19803', function
clear() clear()
local screen = Screen.new(53, 4) local screen = Screen.new(53, 4)
screen:attach() screen:attach()
screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
})
command('hi clear StatusLine') command('hi clear StatusLine')
command('hi clear StatusLineNC') command('hi clear StatusLineNC')
command('vsplit') command('vsplit')
@ -765,11 +742,6 @@ end)
it('showcmdloc=statusline works with vertical splits', function() it('showcmdloc=statusline works with vertical splits', function()
clear() clear()
local screen = Screen.new(53, 4) local screen = Screen.new(53, 4)
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[2] = { bold = true, reverse = true }, -- StatusLine
[3] = { reverse = true }, -- StatusLineNC
}
screen:attach() screen:attach()
command('rightbelow vsplit') command('rightbelow vsplit')
command('set showcmd showcmdloc=statusline') command('set showcmd showcmdloc=statusline')
@ -777,7 +749,7 @@ it('showcmdloc=statusline works with vertical splits', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }| {1:~ }{1:~ }|
{3:[No Name] }{2:[No Name] 1234 }| {2:[No Name] }{3:[No Name] 1234 }|
| |
]]) ]])
feed('<Esc>') feed('<Esc>')
@ -786,7 +758,7 @@ it('showcmdloc=statusline works with vertical splits', function()
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }| {1:~ }{1:~ }|
{2:[No Name] 1234 }| {3:[No Name] 1234 }|
| |
]]) ]])
end) end)
@ -794,25 +766,20 @@ end)
it('keymap is shown with vertical splits #27269', function() it('keymap is shown with vertical splits #27269', function()
clear() clear()
local screen = Screen.new(53, 4) local screen = Screen.new(53, 4)
screen:set_default_attr_ids {
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[2] = { bold = true, reverse = true }, -- StatusLine
[3] = { reverse = true }, -- StatusLineNC
}
screen:attach() screen:attach()
command('setlocal keymap=dvorak') command('setlocal keymap=dvorak')
command('rightbelow vsplit') command('rightbelow vsplit')
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }| {1:~ }{1:~ }|
{3:[No Name] <en-dv> }{2:[No Name] <en-dv> }| {2:[No Name] <en-dv> }{3:[No Name] <en-dv> }|
| |
]]) ]])
command('set laststatus=3') command('set laststatus=3')
screen:expect([[ screen:expect([[
^ | ^ |
{1:~ }{1:~ }| {1:~ }{1:~ }|
{2:[No Name] <en-dv> }| {3:[No Name] <en-dv> }|
| |
]]) ]])
end) end)