aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-11-09 14:14:29 +0100
committerbfredl <bjorn.linse@gmail.com>2024-11-11 14:27:25 +0100
commit29fd5ed606bccab28faaa55fd772704f7ca7d315 (patch)
treee70d2830c10edf20caf1200ed7f2bf742d7a10de
parentd0e78b587195d201d643f3e131dd1ea951d906db (diff)
downloadrneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.gz
rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.bz2
rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.zip
refactor(tests): use more global highlight definitions
-rw-r--r--test/functional/ui/cmdline_spec.lua95
-rw-r--r--test/functional/ui/embed_spec.lua60
-rw-r--r--test/functional/ui/mouse_spec.lua943
-rw-r--r--test/functional/ui/sign_spec.lua357
-rw-r--r--test/functional/ui/statuscolumn_spec.lua471
-rw-r--r--test/functional/ui/statusline_spec.lua125
6 files changed, 963 insertions, 1088 deletions
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 6edfb4a49c..5c9ee61db9 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -13,21 +13,10 @@ local eq = t.eq
local is_os = t.is_os
local api = n.api
+-- TODO(bfredl): make Screen.new(cols, rows, {opts}) just work already
local function new_screen(opt)
local screen = Screen.new(25, 5)
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
end
@@ -189,7 +178,7 @@ local function test_cmdline(linegrid)
},
{
firstc = '=',
- content = { { '1', 6 }, { '+', 7 }, { '2', 6 } },
+ content = { { '1', 26 }, { '+', 15 }, { '2', 26 } },
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':'>'})<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)')
screen:expect {
grid = [[
^ |
- {EOB:~ }|*3
+ {1:~ }|*3
|
]],
cmdline = {
{
prompt = '>',
content = {
- { '(', 'RBP1' },
+ { '(', 30 },
{ 'a' },
- { '(', 'RBP2' },
+ { '(', 10 },
{ 'b' },
- { ')', 'RBP2' },
+ { ')', 10 },
{ 'a' },
- { ')', 'RBP1' },
+ { ')', 30 },
},
pos = 7,
},
@@ -929,17 +913,17 @@ describe('cmdline redraw', function()
|
{1:~ }|*3
{2:[No Name] }|
- {1::}^a{8:bc} |
+ {1::}^a{17:bc} |
{1:~ }|*2
{3:[Command Line] }|
- {9:-- VISUAL --} |
+ {5:-- VISUAL --} |
]])
feed('<C-C>')
screen:expect([[
|
{1:~ }|*3
{2:[No Name] }|
- {1::}a{8:bc} |
+ {1::}a{17:bc} |
{1:~ }|*2
{3:[Command Line] }|
:^abc |
@@ -1093,61 +1077,61 @@ describe('statusline is redrawn on entering cmdline', function()
feed(':echoerr doesnotexist<cr>')
screen:expect {
grid = [[
- {9:c1 }|
+ {5:c1 }|
|
{3:c1 }|
|
{1:~ }|*5
{3: }|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {5:inue}^ |
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {6:inue}^ |
]],
}
feed(':echoerr doesnotexist<cr>')
screen:expect {
grid = [[
- {9:c2 }|
+ {5:c2 }|
|
{3:c2 }|
|
{1:~ }|*2
{3: }|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {5:inue}^ |
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {6:inue}^ |
]],
}
feed(':echoerr doesnotexist<cr>')
screen:expect {
grid = [[
- {9:c3 }|
+ {5:c3 }|
|
{3:c3 }|
{3: }|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {4:E121: Undefined variable: doesnotex}|
- {4:ist} |
- {5:Press ENTER or type command to cont}|
- {5:inue}^ |
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {9:E121: Undefined variable: doesnotex}|
+ {9:ist} |
+ {6:Press ENTER or type command to cont}|
+ {6:inue}^ |
]],
}
feed('<cr>')
screen:expect {
grid = [[
- {9:n3 }|
+ {5:n3 }|
^ |
{3:n3 }|
|
@@ -1202,11 +1186,6 @@ end)
it('tabline is not redrawn in Ex mode #24122', function()
clear()
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()
exec([[
@@ -1224,7 +1203,7 @@ it('tabline is not redrawn in Ex mode #24122', function()
grid = [[
{2:foo }|
|
- {1: }|
+ {3: }|
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>')
screen:expect {
grid = [[
- {1: }|
+ {3: }|
Entering Ex mode. Type "visual" to go to Normal mode. |
:echo 1 |
1 |
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index b2fc25601c..f525b23f7d 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -27,32 +27,30 @@ local function test_embed(ext_linegrid)
-- attach immediately after startup, for early UI
screen = Screen.new(60, 8)
screen:attach { ext_linegrid = ext_linegrid }
- screen:set_default_attr_ids({
- [1] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [2] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [3] = { bold = true, foreground = Screen.colors.Blue1 },
- [4] = { bold = true, foreground = Screen.colors.Green },
- [5] = { bold = true, reverse = true },
- [6] = { foreground = Screen.colors.NvimLightGrey3, background = Screen.colors.NvimDarkGrey3 },
- [7] = { foreground = Screen.colors.NvimDarkRed },
- [8] = { foreground = Screen.colors.NvimDarkCyan },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.NvimDarkCyan },
+ [101] = { foreground = Screen.colors.NvimDarkRed },
+ [102] = {
+ background = Screen.colors.NvimDarkGrey3,
+ foreground = Screen.colors.NvimLightGrey3,
+ },
+ }
end
it('can display errors', function()
startup('--cmd', 'echoerr invalid+')
screen:expect([[
|*4
- {6: }|
- {1:Error detected while processing pre-vimrc command line:} |
- {1:E121: Undefined variable: invalid} |
- {2:Press ENTER or type command to continue}^ |
+ {102: }|
+ {9:Error detected while processing pre-vimrc command line:} |
+ {9:E121: Undefined variable: invalid} |
+ {6:Press ENTER or type command to continue}^ |
]])
feed('<cr>')
screen:expect([[
^ |
- {3:~ }|*6
+ {1:~ }|*6
|
]])
end)
@@ -64,11 +62,11 @@ local function test_embed(ext_linegrid)
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
screen:expect([[
|*3
- {6: }|
- {1:Error detected while processing pre-vimrc command line:} |
- {1:foo} |
- {7:bar} |
- {8:Press ENTER or type command to continue}^ |
+ {102: }|
+ {9:Error detected while processing pre-vimrc command line:} |
+ {9:foo} |
+ {101:bar} |
+ {100:Press ENTER or type command to continue}^ |
]])
end)
@@ -77,11 +75,11 @@ local function test_embed(ext_linegrid)
screen:expect {
grid = [[
|*3
- {6: }|
- {1:Error detected while processing pre-vimrc command line:} |
- {1:foo} |
- {1:bar} |
- {2:Press ENTER or type command to continue}^ |
+ {102: }|
+ {9:Error detected while processing pre-vimrc command line:} |
+ {9:foo} |
+ {9:bar} |
+ {6:Press ENTER or type command to continue}^ |
]],
condition = function()
eq(Screen.colors.Green, screen.default_colors.rgb_bg)
@@ -115,10 +113,6 @@ describe('--embed UI', function()
local screen = Screen.new(40, 8)
screen.rpc_async = true -- Avoid hanging. #24888
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:shutdown(function()
@@ -139,7 +133,7 @@ describe('--embed UI', function()
^ |
from external input |
{1:~ }|*4
- {2:-- INSERT --} |
+ {5:-- INSERT --} |
]]
if not is_os('win') then
@@ -173,10 +167,6 @@ describe('--embed UI', function()
local screen = Screen.new(60, 8)
screen.rpc_async = true -- Avoid hanging. #24888
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:shutdown(function()
@@ -202,7 +192,7 @@ describe('--embed UI', function()
return 666^ |
} |
{1:~ }|*2
- {2:-- INSERT --} |
+ {5:-- INSERT --} |
]]
eq('-', api.nvim_get_option_value('errorfile', {}))
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 471ee70906..3f071ffd6a 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -22,29 +22,20 @@ describe('ui/mouse/input', function()
command('setl listchars=nbsp:x')
screen = Screen.new(25, 5)
screen:attach()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
- [2] = { bold = true },
- [3] = {
- foreground = Screen.colors.Blue,
- background = Screen.colors.LightGrey,
+ screen:add_extra_attr_ids {
+ [100] = {
bold = true,
+ background = Screen.colors.LightGrey,
+ foreground = Screen.colors.Blue1,
},
- [4] = { reverse = true },
- [5] = { bold = true, reverse = true },
- [6] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
- [7] = { bold = true, foreground = Screen.colors.SeaGreen4 },
- [8] = { foreground = Screen.colors.Brown },
- [9] = { background = Screen.colors.DarkGrey, foreground = Screen.colors.LightGrey },
- })
+ }
command('set mousemodel=extend')
feed('itesting<cr>mouse<cr>support and selection<esc>')
screen:expect([[
testing |
mouse |
support and selectio^n |
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -56,7 +47,7 @@ describe('ui/mouse/input', function()
testing |
mo^use |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]],
mouse_enabled = true,
@@ -66,7 +57,7 @@ describe('ui/mouse/input', function()
^testing |
mouse |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -79,7 +70,7 @@ describe('ui/mouse/input', function()
testing |
mo^use |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]],
mouse_enabled = false,
@@ -89,7 +80,7 @@ describe('ui/mouse/input', function()
^testing |
mouse |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -100,11 +91,11 @@ describe('ui/mouse/input', function()
feed('<LeftMouse><0,0>')
feed('<LeftRelease><0,0>')
screen:expect([[
- {1:testin}^g |
+ {17:testin}^g |
mouse |
support and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
end)
@@ -116,11 +107,11 @@ describe('ui/mouse/input', function()
feed('<LeftMouse><0,0>')
feed('<LeftRelease><0,0>')
screen:expect([[
- ^t{1:esting} |
+ ^t{17:esting} |
mouse |
support and selection |
- {0:~ }|
- {2:-- VISUAL LINE --} |
+ {1:~ }|
+ {5:-- VISUAL LINE --} |
]])
end)
@@ -137,44 +128,35 @@ describe('ui/mouse/input', function()
^testing |
mouse |
support and selection |
- {0:~ }|
- {2:-- VISUAL BLOCK --} |
+ {1:~ }|
+ {5:-- VISUAL BLOCK --} |
]])
end)
describe('tab drag', function()
- before_each(function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- tab = { background = Screen.colors.LightGrey, underline = true },
- sel = { bold = true },
- fill = { reverse = true },
- })
- end)
-
it('in tabline on filler space moves tab to the end', function()
feed_command('%delete')
insert('this is foo')
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftDrag><14,0>')
screen:expect([[
- {tab: + bar }{sel: + foo }{fill: }{tab:X}|
+ {24: + bar }{5: + foo }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -185,9 +167,9 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><11,0>')
@@ -196,18 +178,18 @@ describe('ui/mouse/input', function()
poke_eventloop()
screen:expect {
grid = [[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]],
unchanged = true,
}
feed('<LeftDrag><6,0>')
screen:expect([[
- {sel: + bar }{tab: + foo }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {5: + bar }{24: + foo }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
end)
@@ -218,23 +200,23 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftDrag><7,0>')
screen:expect([[
- {tab: + bar }{sel: + foo }{fill: }{tab:X}|
+ {24: + bar }{5: + foo }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -245,33 +227,33 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftDrag><4,1>')
screen:expect {
grid = [[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
unchanged = true,
}
feed('<LeftDrag><14,1>')
screen:expect([[
- {tab: + bar }{sel: + foo }{fill: }{tab:X}|
+ {24: + bar }{5: + foo }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
@@ -282,9 +264,9 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><11,0>')
@@ -293,9 +275,9 @@ describe('ui/mouse/input', function()
poke_eventloop()
screen:expect {
grid = [[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]],
unchanged = true,
@@ -303,18 +285,18 @@ describe('ui/mouse/input', function()
feed('<LeftDrag><11,1>')
screen:expect {
grid = [[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]],
unchanged = true,
}
feed('<LeftDrag><6,1>')
screen:expect([[
- {sel: + bar }{tab: + foo }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {5: + bar }{24: + foo }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
end)
@@ -325,73 +307,64 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftDrag><4,1>')
screen:expect {
grid = [[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
unchanged = true,
}
feed('<LeftDrag><7,1>')
screen:expect([[
- {tab: + bar }{sel: + foo }{fill: }{tab:X}|
+ {24: + bar }{5: + foo }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end)
end)
describe('tabline', function()
- before_each(function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- tab = { background = Screen.colors.LightGrey, underline = true },
- sel = { bold = true },
- fill = { reverse = true },
- })
- end)
-
it('left click in default tabline (tabpage label) switches to tab', function()
feed_command('%delete')
insert('this is foo')
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><4,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftMouse><6,0>')
screen:expect_unchanged()
feed('<LeftMouse><10,0>')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><12,0>')
@@ -404,23 +377,23 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><20,0>')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<LeftMouse><22,0>')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
end)
@@ -432,15 +405,15 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<LeftMouse><24,0>')
screen:expect([[
this is fo^o |
- {0:~ }|*3
+ {1:~ }|*3
|
]])
end)
@@ -451,44 +424,44 @@ describe('ui/mouse/input', function()
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<2-LeftMouse><4,0>')
screen:expect([[
- {sel: Name] }{tab: + foo + bar }{fill: }{tab:X}|
- {0:^$} |
- {0:~ }|*2
+ {5: Name] }{24: + foo + bar }{2: }{24:X}|
+ {1:^$} |
+ {1:~ }|*2
|
]])
command('tabclose')
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
this is fo^o |
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<2-LeftMouse><20,0>')
screen:expect([[
- {tab: + foo + bar }{sel: Name] }{fill: }{tab:X}|
- {0:^$} |
- {0:~ }|*2
+ {24: + foo + bar }{5: Name] }{2: }{24:X}|
+ {1:^$} |
+ {1:~ }|*2
|
]])
command('tabclose')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- this is ba^r{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ this is ba^r{1:$} |
+ {1:~ }|*2
|
]])
feed('<2-LeftMouse><10,0>')
screen:expect([[
- {tab: + foo }{sel: Name] }{tab: + bar }{fill: }{tab:X}|
- {0:^$} |
- {0:~ }|*2
+ {24: + foo }{5: Name] }{24: + bar }{2: }{24:X}|
+ {1:^$} |
+ {1:~ }|*2
|
]])
end)
@@ -509,7 +482,7 @@ describe('ui/mouse/input', function()
api.nvim_set_option_value('tabline', '%@Test@test%X-%5@Test2@test2', {})
api.nvim_set_option_value('showtabline', 2, {})
screen:expect([[
- {fill:test-test2 }|
+ {2:test-test2 }|
testing |
mouse |
support and selectio^n |
@@ -594,48 +567,41 @@ describe('ui/mouse/input', function()
testing |
mo^use |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]])
feed('<LeftDrag><4,1>')
screen:expect([[
testing |
- mo{1:us}^e |
+ mo{17:us}^e |
support and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
feed('<LeftDrag><2,2>')
screen:expect([[
testing |
- mo{1:use} |
- {1:su}^pport and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ mo{17:use} |
+ {17:su}^pport and selection |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
feed('<LeftDrag><0,0>')
screen:expect([[
- ^t{1:esting} |
- {1:mou}se |
+ ^t{17:esting} |
+ {17:mou}se |
support and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
end)
it('left drag changes visual selection after tab click', function()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- tab = { background = Screen.colors.LightGrey, underline = true },
- sel = { bold = true },
- fill = { reverse = true },
- vis = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
- })
feed_command('silent file foo | tabnew | file bar')
insert('this is bar')
feed_command('tabprevious') -- go to first tab
screen:expect([[
- {sel: + foo }{tab: + bar }{fill: }{tab:X}|
+ {5: + foo }{24: + bar }{2: }{24:X}|
testing |
mouse |
support and selectio^n |
@@ -645,17 +611,17 @@ describe('ui/mouse/input', function()
n.poke_eventloop()
feed('<LeftMouse><0,1>')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- ^this is bar{0:$} |
- {0:~ }|*2
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ ^this is bar{1:$} |
+ {1:~ }|*2
:tabprevious |
]])
feed('<LeftDrag><4,1>')
screen:expect([[
- {tab: + foo }{sel: + bar }{fill: }{tab:X}|
- {vis:this}^ is bar{0:$} |
- {0:~ }|*2
- {sel:-- VISUAL --} |
+ {24: + foo }{5: + bar }{2: }{24:X}|
+ {17:this}^ is bar{1:$} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]])
end)
@@ -673,12 +639,12 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|*2
- {0:~ }│{4:[No Name] [+] }|
- {0:~ }│foo{0:$} |
- {0:~ }│ba^r{0:$} |
- {0:~ }│{0:~ }|*4
- {4:[No Name] [+] }{5:[No Name] [+] }|
+ {1:~ }│{1:~ }|*2
+ {1:~ }│{2:[No Name] [+] }|
+ {1:~ }│foo{1:$} |
+ {1:~ }│ba^r{1:$} |
+ {1:~ }│{1:~ }|*4
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]],
}
@@ -689,12 +655,12 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|*2
- {0:~ }│{4:[No Name] [+] }|
- {0:~ }│^foo{0:$} |
- {0:~ }│bar{0:$} |
- {0:~ }│{0:~ }|*4
- {4:[No Name] [+] }{5:[No Name] [+] }|
+ {1:~ }│{1:~ }|*2
+ {1:~ }│{2:[No Name] [+] }|
+ {1:~ }│^foo{1:$} |
+ {1:~ }│bar{1:$} |
+ {1:~ }│{1:~ }|*4
+ {2:[No Name] [+] }{3:[No Name] [+] }|
|
]],
}
@@ -705,13 +671,13 @@ describe('ui/mouse/input', function()
testing │testing |
mouse │mouse |
support and selection │support and selection |
- {0:~ }│{0:~ }|*2
- {0:~ }│{4:[No Name] [+] }|
- {0:~ }│{1:foo}{3:$} |
- {0:~ }│{1:bar}{0:^$} |
- {0:~ }│{0:~ }|*4
- {4:[No Name] [+] }{5:[No Name] [+] }|
- {2:-- VISUAL --} |
+ {1:~ }│{1:~ }|*2
+ {1:~ }│{2:[No Name] [+] }|
+ {1:~ }│{17:foo}{100:$} |
+ {1:~ }│{17:bar}{1:^$} |
+ {1:~ }│{1:~ }|*4
+ {2:[No Name] [+] }{3:[No Name] [+] }|
+ {5:-- VISUAL --} |
]],
}
end)
@@ -723,33 +689,33 @@ describe('ui/mouse/input', function()
screen:expect([[
testing |
mouse |
- {1:suppor}^t and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ {17:suppor}^t and selection |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
feed('<LeftDrag><0,1>')
screen:expect([[
testing |
- ^m{1:ouse} |
- {1:support} and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ ^m{17:ouse} |
+ {17:support} and selection |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
feed('<LeftDrag><4,0>')
screen:expect([[
- ^t{1:esting} |
- {1:mouse} |
- {1:support} and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ ^t{17:esting} |
+ {17:mouse} |
+ {17:support} and selection |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
feed('<LeftDrag><14,2>')
screen:expect([[
testing |
mouse |
- {1:support and selectio}^n |
- {0:~ }|
- {2:-- VISUAL --} |
+ {17:support and selectio}^n |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
end)
@@ -762,33 +728,33 @@ describe('ui/mouse/input', function()
screen:expect([[
testing |
mouse |
- {1:su}^p{1:port and selection} |
- {0:~ }|
- {2:-- VISUAL LINE --} |
+ {17:su}^p{17:port and selection} |
+ {1:~ }|
+ {5:-- VISUAL LINE --} |
]])
feed('<LeftDrag><0,1>')
screen:expect([[
testing |
- ^m{1:ouse} |
- {1:support and selection} |
- {0:~ }|
- {2:-- VISUAL LINE --} |
+ ^m{17:ouse} |
+ {17:support and selection} |
+ {1:~ }|
+ {5:-- VISUAL LINE --} |
]])
feed('<LeftDrag><4,0>')
screen:expect([[
- {1:test}^i{1:ng} |
- {1:mouse} |
- {1:support and selection} |
- {0:~ }|
- {2:-- VISUAL LINE --} |
+ {17:test}^i{17:ng} |
+ {17:mouse} |
+ {17:support and selection} |
+ {1:~ }|
+ {5:-- VISUAL LINE --} |
]])
feed('<LeftDrag><14,2>')
screen:expect([[
testing |
mouse |
- {1:support and se}^l{1:ection} |
- {0:~ }|
- {2:-- VISUAL LINE --} |
+ {17:support and se}^l{17:ection} |
+ {1:~ }|
+ {5:-- VISUAL LINE --} |
]])
end)
@@ -804,32 +770,32 @@ describe('ui/mouse/input', function()
testing |
mouse |
su^pport and selection |
- {0:~ }|
- {2:-- VISUAL BLOCK --} |
+ {1:~ }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('<LeftDrag><0,1>')
screen:expect([[
testing |
- ^m{1:ou}se |
- {1:sup}port and selection |
- {0:~ }|
- {2:-- VISUAL BLOCK --} |
+ ^m{17:ou}se |
+ {17:sup}port and selection |
+ {1:~ }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('<LeftDrag><4,0>')
screen:expect([[
- te{1:st}^ing |
- mo{1:use} |
- su{1:ppo}rt and selection |
- {0:~ }|
- {2:-- VISUAL BLOCK --} |
+ te{17:st}^ing |
+ mo{17:use} |
+ su{17:ppo}rt and selection |
+ {1:~ }|
+ {5:-- VISUAL BLOCK --} |
]])
feed('<LeftDrag><14,2>')
screen:expect([[
testing |
mouse |
- su{1:pport and se}^lection |
- {0:~ }|
- {2:-- VISUAL BLOCK --} |
+ su{17:pport and se}^lection |
+ {1:~ }|
+ {5:-- VISUAL BLOCK --} |
]])
end)
@@ -839,16 +805,16 @@ describe('ui/mouse/input', function()
^testing |
mouse |
support and selection |
- {0:~ }|
+ {1:~ }|
|
]])
feed('<RightMouse><2,2>')
screen:expect([[
- {1:testing} |
- {1:mouse} |
- {1:su}^pport and selection |
- {0:~ }|
- {2:-- VISUAL --} |
+ {17:testing} |
+ {17:mouse} |
+ {17:su}^pport and selection |
+ {1:~ }|
+ {5:-- VISUAL --} |
]])
end)
@@ -856,11 +822,11 @@ describe('ui/mouse/input', function()
api.nvim_set_option_value('tags', './non-existent-tags-file', {})
feed('<C-LeftMouse><0,0>')
screen:expect([[
- {6:E433: No tags file} |
- {6:E426: Tag not found: test}|
- {6:ing} |
- {7:Press ENTER or type comma}|
- {7:nd to continue}^ |
+ {9:E433: No tags file} |
+ {9:E426: Tag not found: test}|
+ {9:ing} |
+ {6:Press ENTER or type comma}|
+ {6:nd to continue}^ |
]])
feed('<cr>')
end)
@@ -890,54 +856,54 @@ describe('ui/mouse/input', function()
local oldwin = api.nvim_get_current_win()
command('rightbelow vnew')
screen:expect([[
- testing │{0:^$} |
- mouse │{0:~ }|
- support and selection │{0:~ }|
- {4:[No Name] [+] }{5:[No Name] }|
+ testing │{1:^$} |
+ mouse │{1:~ }|
+ support and selection │{1:~ }|
+ {2:[No Name] [+] }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 22)
poke_eventloop()
api.nvim_input_mouse('left', 'drag', '', 0, 1, 12)
screen:expect([[
- testing │{0:^$} |
- mouse │{0:~ }|
- support and │{0:~ }|
- {4:< Name] [+] }{5:[No Name] }|
+ testing │{1:^$} |
+ mouse │{1:~ }|
+ support and │{1:~ }|
+ {2:< Name] [+] }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'drag', '', 0, 2, 2)
screen:expect([[
- te│{0:^$} |
- mo│{0:~ }|
- su│{0:~ }|
- {4:< }{5:[No Name] }|
+ te│{1:^$} |
+ mo│{1:~ }|
+ su│{1:~ }|
+ {2:< }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'release', '', 0, 2, 2)
api.nvim_set_option_value('statuscolumn', 'foobar', { win = oldwin })
screen:expect([[
- {8:fo}│{0:^$} |
- {8:fo}│{0:~ }|*2
- {4:< }{5:[No Name] }|
+ {8:fo}│{1:^$} |
+ {8:fo}│{1:~ }|*2
+ {2:< }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 2)
poke_eventloop()
api.nvim_input_mouse('left', 'drag', '', 0, 1, 12)
screen:expect([[
- {8:foobar}testin│{0:^$} |
- {8:foobar}mouse │{0:~ }|
- {8:foobar}suppor│{0:~ }|
- {4:< Name] [+] }{5:[No Name] }|
+ {8:foobar}testin│{1:^$} |
+ {8:foobar}mouse │{1:~ }|
+ {8:foobar}suppor│{1:~ }|
+ {2:< Name] [+] }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'drag', '', 0, 2, 22)
screen:expect([[
- {8:foobar}testing │{0:^$} |
- {8:foobar}mouse │{0:~ }|
- {8:foobar}support and sele│{0:~ }|
- {4:[No Name] [+] }{5:[No Name] }|
+ {8:foobar}testing │{1:^$} |
+ {8:foobar}mouse │{1:~ }|
+ {8:foobar}support and sele│{1:~ }|
+ {2:[No Name] [+] }{3:[No Name] }|
|
]])
api.nvim_input_mouse('left', 'release', '', 0, 2, 22)
@@ -964,14 +930,14 @@ describe('ui/mouse/input', function()
test │test |
^mouse scrolling │mouse scrolling |
│ |
- {0:~ }│{0:~ }|
- {5:[No Name] [+] }{4:[No Name] [+] }|
+ {1:~ }│{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- {0:~ }|
- {4:[No Name] [+] }|
+ {1:~ }|
+ {2:[No Name] [+] }|
:vsp |
]])
if use_api then
@@ -982,17 +948,17 @@ describe('ui/mouse/input', function()
screen:expect([[
^mouse scrolling │lines |
│to |
- {0:~ }│test |
- {0:~ }│mouse scrolling |
- {0:~ }│ |
- {0:~ }│{0:~ }|
- {5:[No Name] [+] }{4:[No Name] [+] }|
+ {1:~ }│test |
+ {1:~ }│mouse scrolling |
+ {1:~ }│ |
+ {1:~ }│{1:~ }|
+ {3:[No Name] [+] }{2:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- {0:~ }|
- {4:[No Name] [+] }|
+ {1:~ }|
+ {2:[No Name] [+] }|
:vsp |
]])
if use_api then
@@ -1003,17 +969,17 @@ describe('ui/mouse/input', function()
screen:expect([[
^mouse scrolling │text |
│with |
- {0:~ }│many |
- {0:~ }│lines |
- {0:~ }│to |
- {0:~ }│test |
- {5:[No Name] [+] }{4:[No Name] [+] }|
+ {1:~ }│many |
+ {1:~ }│lines |
+ {1:~ }│to |
+ {1:~ }│test |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- {0:~ }|
- {4:[No Name] [+] }|
+ {1:~ }|
+ {2:[No Name] [+] }|
:vsp |
]])
if use_api then
@@ -1025,17 +991,17 @@ describe('ui/mouse/input', function()
screen:expect([[
^mouse scrolling │text |
│with |
- {0:~ }│many |
- {0:~ }│lines |
- {0:~ }│to |
- {0:~ }│test |
- {5:[No Name] [+] }{4:[No Name] [+] }|
+ {1:~ }│many |
+ {1:~ }│lines |
+ {1:~ }│to |
+ {1:~ }│test |
+ {3:[No Name] [+] }{2:[No Name] [+] }|
Inserting |
text |
with |
many |
lines |
- {4:[No Name] [+] }|
+ {2:[No Name] [+] }|
:vsp |
]])
end
@@ -1056,7 +1022,7 @@ describe('ui/mouse/input', function()
screen:expect([[
|*2
bbbbbbbbbbbbbbb^b |
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1064,7 +1030,7 @@ describe('ui/mouse/input', function()
screen:expect([[
|*2
n bbbbbbbbbbbbbbbbbbb^b |
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1073,7 +1039,7 @@ describe('ui/mouse/input', function()
g |
|
^t and selection bbbbbbbbb|
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -1086,7 +1052,7 @@ describe('ui/mouse/input', function()
screen:expect([[
|*2
bbbbbbbbbbbbbbb^b |
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1094,7 +1060,7 @@ describe('ui/mouse/input', function()
screen:expect([[
|*2
n bbbbbbbbbbbbbbbbbbb^b |
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1104,7 +1070,7 @@ describe('ui/mouse/input', function()
g |
|
^t and selection bbbbbbbbb|
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -1118,7 +1084,7 @@ describe('ui/mouse/input', function()
testing |
mouse |
^bbbbbbbbbbbbbbbbbbbb supp|
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1127,7 +1093,7 @@ describe('ui/mouse/input', function()
g |
|
bbbb^bbbbbbbbbb support an|
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1138,7 +1104,7 @@ describe('ui/mouse/input', function()
testing |
mouse |
^bbbbbbbbbbbbbbbbbbbb supp|
- {0:~ }|
+ {1:~ }|
|
]])
@@ -1147,7 +1113,7 @@ describe('ui/mouse/input', function()
g |
|
bb^bbbbbbbbbbbb support an|
- {0:~ }|
+ {1:~ }|
|
]])
end)
@@ -1158,71 +1124,71 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><0,0>')
screen:expect([[
- ^Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ ^Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:>} 私は猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><1,0>')
screen:expect([[
- S^ection{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ S^ection{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:>} 私は猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><21,0>')
screen:expect([[
- Section{0:>>--->--->---}{c: }^t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ Section{1:>>--->--->---}{14: }^t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:>} 私は猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><21,1>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t^3{c: } {c: }|
- {c:>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t^3{14: } {14: }|
+ {14:>} 私は猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><0,2>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:^>} 私は猫が大好き{0:>---}{c: X } {0:>}|
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:^>} 私は猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><7,2>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:>} 私は^猫が大好き{0:>---}{c: X } {0:>}|
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:>} 私は^猫が大好き{1:>---}{14: X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><21,2>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- {c:>} 私は猫が大好き{0:>---}{c: ^X } {0:>}|
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ {14:>} 私は猫が大好き{1:>---}{14: ^X } {1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end) -- level 1 - non wrapped
@@ -1232,51 +1198,51 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><24,1>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c:^ }|
- t4{c: } |
- {c:>} 私は猫が大好き{0:>---}{c: X} |
- {c: } ✨🐈✨ |
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14:^ }|
+ t4{14: } |
+ {14:>} 私は猫が大好き{1:>---}{14: X} |
+ {14: } ✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><0,2>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- ^t4{c: } |
- {c:>} 私は猫が大好き{0:>---}{c: X} |
- {c: } ✨🐈✨ |
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ ^t4{14: } |
+ {14:>} 私は猫が大好き{1:>---}{14: X} |
+ {14: } ✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><8,3>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- t4{c: } |
- {c:>} 私は猫^が大好き{0:>---}{c: X} |
- {c: } ✨🐈✨ |
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ t4{14: } |
+ {14:>} 私は猫^が大好き{1:>---}{14: X} |
+ {14: } ✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><21,3>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- t4{c: } |
- {c:>} 私は猫が大好き{0:>---}{c: ^X} |
- {c: } ✨🐈✨ |
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ t4{14: } |
+ {14:>} 私は猫が大好き{1:>---}{14: ^X} |
+ {14: } ✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><4,4>')
screen:expect([[
- Section{0:>>--->--->---}{c: }t1{c: } |
- {0:>--->--->---} {c: }t2{c: } {c: }t3{c: } {c: }|
- t4{c: } |
- {c:>} 私は猫が大好き{0:>---}{c: X} |
- {c: } ✨^🐈✨ |
+ Section{1:>>--->--->---}{14: }t1{14: } |
+ {1:>--->--->---} {14: }t2{14: } {14: }t3{14: } {14: }|
+ t4{14: } |
+ {14:>} 私は猫が大好き{1:>---}{14: X} |
+ {14: } ✨^🐈✨ |
|*2
]])
end) -- level 1 - wrapped
@@ -1286,61 +1252,61 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><20,0>')
screen:expect([[
- Section{0:>>--->--->---}^t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}^t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><14,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} ^t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} ^t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><18,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t^3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t^3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><0,2>') -- Weirdness
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:^>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><8,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫^が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><20,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:^X} ✨{1:>}|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end) -- level 2 - non wrapped
@@ -1350,62 +1316,62 @@ describe('ui/mouse/input', function()
feed('<esc>i<LeftMouse><20,0>')
screen:expect([[
- Section{0:>>--->--->---}^t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}^t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
feed('<LeftMouse><14,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} ^t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} ^t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
feed('<LeftMouse><18,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t^3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t^3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
feed('<LeftMouse><0,2>') -- Weirdness
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:^>} 私は猫が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:^>} 私は猫が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
feed('<LeftMouse><8,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫^が大好き{0:>---}{c:X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫^が大好き{1:>---}{14:X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
feed('<LeftMouse><20,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- {c:>} 私は猫が大好き{0:>---}{c:^X} ✨{0:>}|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ {14:>} 私は猫が大好き{1:>---}{14:^X} ✨{1:>}|
|
- {0:~ }|*2
- {sm:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]])
end) -- level 2 - non wrapped (insert mode)
@@ -1414,30 +1380,30 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><20,0>')
screen:expect([[
- Section{0:>>--->--->---}^t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}^t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><14,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} ^t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} ^t2 t3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><18,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t^3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t^3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
@@ -1450,60 +1416,60 @@ describe('ui/mouse/input', function()
-- reevaluated.
feed('<esc><LeftMouse><0,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 ^ |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 ^ |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><1,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t^4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><0,3>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- {c:^>} 私は猫が大好き{0:>---}{c:X} |
+ {14:^>} 私は猫が大好き{1:>---}{14:X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><20,3>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:^X} |
+ {14:>} 私は猫が大好き{1:>---}{14:^X} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><1,4>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
^✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><5,4>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- {c:>} 私は猫が大好き{0:>---}{c:X} |
+ {14:>} 私は猫が大好き{1:>---}{14:X} |
✨🐈^✨ |
|*2
]])
@@ -1514,42 +1480,42 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><0,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- ^ 私は猫が大好き{0:>----} ✨🐈|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ ^ 私は猫が大好き{1:>----} ✨🐈|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><1,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- ^私は猫が大好き{0:>----} ✨🐈|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ ^私は猫が大好き{1:>----} ✨🐈|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><13,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- 私は猫が大好^き{0:>----} ✨🐈|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ 私は猫が大好^き{1:>----} ✨🐈|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
feed('<esc><LeftMouse><20,2>')
feed('zH') -- FIXME: unnecessary horizontal scrolling
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 t4 |
- 私は猫が大好き{0:>----}^ ✨🐈|
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 t4 |
+ 私は猫が大好き{1:>----}^ ✨🐈|
|
- {0:~ }|*2
+ {1:~ }|*2
|
]])
end) -- level 3 - non wrapped
@@ -1559,80 +1525,80 @@ describe('ui/mouse/input', function()
feed('<esc><LeftMouse><14,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} ^t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} ^t2 t3 |
t4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><18,1>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t^3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t^3 |
t4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><1,2>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t^4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><0,3>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- ^ 私は猫が大好き{0:>----} |
+ ^ 私は猫が大好き{1:>----} |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><20,3>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- 私は猫が大好き{0:>----}^ |
+ 私は猫が大好き{1:>----}^ |
✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><1,4>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
^✨🐈✨ |
|*2
]])
feed('<esc><LeftMouse><3,4>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
✨^🐈✨ |
|*2
]])
feed('<esc><LeftMouse><5,4>')
screen:expect([[
- Section{0:>>--->--->---}t1 |
- {0:>--->--->---} t2 t3 |
+ Section{1:>>--->--->---}t1 |
+ {1:>--->--->---} t2 t3 |
t4 |
- 私は猫が大好き{0:>----} |
+ 私は猫が大好き{1:>----} |
✨🐈^✨ |
|*2
]])
@@ -1645,11 +1611,6 @@ describe('ui/mouse/input', function()
before_each(function()
screen:try_resize(25, 7)
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- c = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
- sm = { bold = true },
- })
feed('ggdG')
command([[setlocal concealcursor=ni nowrap shiftwidth=2 tabstop=4 list listchars=tab:>-]])
@@ -1712,23 +1673,23 @@ describe('ui/mouse/input', function()
command('syntax match test /|hidden|/ conceal cchar=X')
command('set conceallevel=2 concealcursor=n virtualedit=all')
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbbb |
- bbb{9:X}ccccccccc^c |
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbbb |
+ bbb{14:X}ccccccccc^c |
+ {1:~ }|*2
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 22)
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbb^b |
- bbb{9:X}cccccccccc |
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbb^b |
+ bbb{14:X}cccccccccc |
+ {1:~ }|*2
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 1, 16)
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbbb |
- bbb{9:X}cccccccccc ^ |
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbbb |
+ bbb{14:X}cccccccccc ^ |
+ {1:~ }|*2
|
]])
@@ -1738,23 +1699,23 @@ describe('ui/mouse/input', function()
virt_text_repeat_linebreak = true,
})
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbbb {6:?}|
- bbb{9:X}cccccccccc ^ {6:?}|
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbbb {9:?}|
+ bbb{14:X}cccccccccc ^ {9:?}|
+ {1:~ }|*2
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 22)
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbb^b {6:?}|
- bbb{9:X}cccccccccc {6:?}|
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbb^b {9:?}|
+ bbb{14:X}cccccccccc {9:?}|
+ {1:~ }|*2
|
]])
api.nvim_input_mouse('left', 'press', '', 0, 1, 16)
screen:expect([[
- aaaaaaaaaa{9:X}bbbbbbb {6:?}|
- bbb{9:X}cccccccccc ^ {6:?}|
- {0:~ }|*2
+ aaaaaaaaaa{14:X}bbbbbbb {9:?}|
+ bbb{14:X}cccccccccc ^ {9:?}|
+ {1:~ }|*2
|
]])
end)
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index 30da79af47..da61b6d30f 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -13,20 +13,9 @@ describe('Signs', function()
clear()
screen = Screen.new()
screen:attach()
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = 255 },
- [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 },
- })
+ screen:add_extra_attr_ids {
+ [100] = { bold = true, foreground = Screen.colors.Magenta1 },
+ }
end)
describe(':sign place', function()
@@ -39,10 +28,10 @@ describe('Signs', function()
sign place 2 line=2 name=piet2 buffer=1
]])
screen:expect([[
- {1:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a |
- {1:𠜎̀́̂̃̄̅}b |
- {2: }^ |
- {0:~ }|*10
+ {10:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a |
+ {10:𠜎̀́̂̃̄̅}b |
+ {7: }^ |
+ {1:~ }|*10
|
]])
end)
@@ -57,11 +46,11 @@ describe('Signs', function()
sign place 3 line=1 name=pietx buffer=1
]])
screen:expect([[
- {1:>!}a |
- {2: }b |
- {1:>>}c |
- {2: }^ |
- {0:~ }|*9
+ {10:>!}a |
+ {7: }b |
+ {10:>>}c |
+ {7: }^ |
+ {1:~ }|*9
|
]])
end)
@@ -74,7 +63,7 @@ describe('Signs', function()
a |
b |
^ |
- {0:~ }|*10
+ {1:~ }|*10
|
]])
end)
@@ -91,18 +80,18 @@ describe('Signs', function()
sign place 3 line=2 name=piet buffer=1
]])
screen:expect([[
- {2: }{3:^a }|
- {1:>>}b |
- {2: }c |
- {2: } |
- {0:~ }|*2
- {4:[No Name] [+] }|
- {2: }{3:a }|
- {1:>>}b |
- {2: }c |
- {2: } |
- {0:~ }|
- {5:[No Name] [+] }|
+ {7: }{21:^a }|
+ {10:>>}b |
+ {7: }c |
+ {7: } |
+ {1:~ }|*2
+ {3:[No Name] [+] }|
+ {7: }{21:a }|
+ {10:>>}b |
+ {7: }c |
+ {7: } |
+ {1:~ }|
+ {2:[No Name] [+] }|
|
]])
end)
@@ -122,11 +111,11 @@ describe('Signs', function()
sign place 6 line=4 name=pietxx buffer=1
]])
screen:expect([[
- {1:>>}{6: 1 }a |
- {2: }{6: 2 }{8:b }|
- {2: }{7: 3 }c |
- {1:>>}{7: 4 }{8:^ }|
- {0:~ }|*9
+ {10:>>}{8: 1 }a |
+ {7: }{8: 2 }{9:b }|
+ {7: }{13: 3 }c |
+ {10:>>}{13: 4 }{9:^ }|
+ {1:~ }|*9
|
]])
-- Check that 'statuscolumn' correctly applies numhl
@@ -144,45 +133,45 @@ describe('Signs', function()
set cursorline
]])
screen:expect([[
- {1:>>}a |
- {1:>>}b |
- {8:>>}{3:^c }|
- {0:~ }|*10
+ {10:>>}a |
+ {10:>>}b |
+ {9:>>}{21:^c }|
+ {1:~ }|*10
|
]])
feed('k')
screen:expect([[
- {1:>>}a |
- {8:>>}{3:^b }|
- {1:>>}c |
- {0:~ }|*10
+ {10:>>}a |
+ {9:>>}{21:^b }|
+ {10:>>}c |
+ {1:~ }|*10
|
]])
exec('set nocursorline')
screen:expect([[
- {1:>>}a |
- {1:>>}^b |
- {1:>>}c |
- {0:~ }|*10
+ {10:>>}a |
+ {10:>>}^b |
+ {10:>>}c |
+ {1:~ }|*10
|
]])
exec('set cursorline cursorlineopt=line')
screen:expect([[
- {1:>>}a |
- {1:>>}{3:^b }|
- {1:>>}c |
- {0:~ }|*10
+ {10:>>}a |
+ {10:>>}{21:^b }|
+ {10:>>}c |
+ {1:~ }|*10
|
]])
exec('set cursorlineopt=number')
exec('hi! link SignColumn IncSearch')
feed('Go<esc>2G')
screen:expect([[
- {1:>>}a |
- {8:>>}^b |
- {1:>>}c |
- {5: } |
- {0:~ }|*9
+ {10:>>}a |
+ {9:>>}^b |
+ {10:>>}c |
+ {2: } |
+ {1:~ }|*9
|
]])
-- 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,
-- and presented by their sorted Id order.
screen:expect([[
- {2: }{6: 1 }a |
- {2: }{6: 2 }b |
- WW{1:>>}{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {7: }{8: 1 }a |
+ {7: }{8: 2 }b |
+ WW{10:>>}{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
exec([[
@@ -221,42 +210,42 @@ describe('Signs', function()
sign place 3 line=2 name=pietError buffer=1
]])
screen:expect([[
- {8:XX}{1:>>}{6: 1 }a |
- {1:>>}{8:XX}{6: 2 }b |
- WW{1:>>}{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {9:XX}{10:>>}{8: 1 }a |
+ {10:>>}{9:XX}{8: 2 }b |
+ WW{10:>>}{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- With the default setting, we get the sign with the top id.
exec('set signcolumn=yes:1')
screen:expect([[
- {8:XX}{6: 1 }a |
- {1:>>}{6: 2 }b |
- WW{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {9:XX}{8: 1 }a |
+ {10:>>}{8: 2 }b |
+ WW{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- "auto:3" accommodates all the signs we defined so far.
exec('set signcolumn=auto:3')
local s3 = [[
- {8:XX}{1:>>}{2: }{6: 1 }a |
- {1:>>}{8:XX}{2: }{6: 2 }b |
- WW{1:>>}{8:XX}{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {9:XX}{10:>>}{7: }{8: 1 }a |
+ {10:>>}{9:XX}{7: }{8: 2 }b |
+ WW{10:>>}{9:XX}{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]]
screen:expect(s3)
-- Check "yes:9".
exec('set signcolumn=yes:9')
screen:expect([[
- {8:XX}{1:>>}{2: }{6: 1 }a |
- {1:>>}{8:XX}{2: }{6: 2 }b |
- WW{1:>>}{8:XX}{2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {9:XX}{10:>>}{7: }{8: 1 }a |
+ {10:>>}{9:XX}{7: }{8: 2 }b |
+ WW{10:>>}{9:XX}{7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- Check "auto:N" larger than the maximum number of signs defined in
@@ -267,19 +256,19 @@ describe('Signs', function()
exec('3move1')
exec('2d')
screen:expect([[
- {8:XX}{1:>>}{6: 1 }a |
- {1:>>}{8:XX}{6: 2 }^b |
- {2: }{6: 3 } |
- {0:~ }|*10
+ {9:XX}{10:>>}{8: 1 }a |
+ {10:>>}{9:XX}{8: 2 }^b |
+ {7: }{8: 3 } |
+ {1:~ }|*10
|
]])
-- character deletion does not delete signs.
feed('x')
screen:expect([[
- {8:XX}{1:>>}{6: 1 }a |
- {1:>>}{8:XX}{6: 2 }^ |
- {2: }{6: 3 } |
- {0:~ }|*10
+ {9:XX}{10:>>}{8: 1 }a |
+ {10:>>}{9:XX}{8: 2 }^ |
+ {7: }{8: 3 } |
+ {1:~ }|*10
|
]])
end)
@@ -290,21 +279,21 @@ describe('Signs', function()
-- sign column should always accommodate at the minimum size
exec('set signcolumn=auto:1-3')
screen:expect([[
- {2: }{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {7: }{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- should support up to 8 signs at minimum
exec('set signcolumn=auto:8-9')
screen:expect([[
- {2: }{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {7: }{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- 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 place 1 line=1 name=pietSearch buffer=1')
screen:expect([[
- {1:>>}{2: }{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {10:>>}{7: }{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- 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
]])
screen:expect([[
- {1:>>>>>>>>}{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {10:>>>>>>>>}{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
-- should not increase size because sign with existing id is moved
@@ -340,11 +329,11 @@ describe('Signs', function()
screen:expect_unchanged()
exec('sign unplace 4')
screen:expect([[
- {1:>>>>>>}{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {10:>>>>>>}{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
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
]])
screen:expect([[
- {1:>>>>>>>>>>}{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {10:>>>>>>>>>>}{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
end)
@@ -377,21 +366,21 @@ describe('Signs', function()
]])
-- no signcolumn with only empty sign
screen:expect([[
- {6: 1 }a |
- {6: 2 }b |
- {6: 3 }c |
- {6: 4 }^ |
- {0:~ }|*9
+ {8: 1 }a |
+ {8: 2 }b |
+ {8: 3 }c |
+ {8: 4 }^ |
+ {1:~ }|*9
|
]])
-- single column with 1 sign with text and one sign without
exec('sign place 1 line=1 name=pietSearch buffer=1')
screen:expect([[
- {1:>>}{6: 1 }a |
- {2: }{6: 2 }b |
- {2: }{6: 3 }c |
- {2: }{6: 4 }^ |
- {0:~ }|*9
+ {10:>>}{8: 1 }a |
+ {7: }{8: 2 }b |
+ {7: }{8: 3 }c |
+ {7: }{8: 4 }^ |
+ {1:~ }|*9
|
]])
end)
@@ -408,23 +397,23 @@ describe('Signs', function()
-- 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
screen:expect([[
- {1: >> }a |
- {8: 2 }b |
- {6: 3 }c |
- {6: 4 }^ |
- {0:~ }|*9
+ {10: >> }a |
+ {9: 2 }b |
+ {8: 3 }c |
+ {8: 4 }^ |
+ {1:~ }|*9
|
]])
-- number column on wrapped part of a line should be empty
feed('gg100aa<Esc>')
screen:expect([[
- {1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {8: }aa^a |
- {8: 2 }b |
- {6: 3 }c |
- {6: 4 } |
- {0:~ }|*7
+ {10: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {9: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {9: }aa^a |
+ {9: 2 }b |
+ {8: 3 }c |
+ {8: 4 } |
+ {1:~ }|*7
|
]])
api.nvim_buf_set_extmark(0, api.nvim_create_namespace('test'), 0, 0, {
@@ -434,14 +423,14 @@ describe('Signs', function()
feed('<C-Y>')
-- number column on virtual lines should be empty
screen:expect([[
- {6: }VIRT LINES |
- {1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {8: }aa^a |
- {8: 2 }b |
- {6: 3 }c |
- {6: 4 } |
- {0:~ }|*6
+ {8: }VIRT LINES |
+ {10: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {9: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {9: }aa^a |
+ {9: 2 }b |
+ {8: 3 }c |
+ {8: 4 } |
+ {1:~ }|*6
|
]])
end)
@@ -451,21 +440,21 @@ describe('Signs', function()
exec('sign place 100000 line=1 name=piet buffer=1')
feed(':sign place<cr>')
screen:expect([[
- {1:>>} |
- {0:~ }|*6
- {4: }|
+ {10:>>} |
+ {1:~ }|*6
+ {3: }|
:sign place |
- {9:--- Signs ---} |
- {10:Signs for [NULL]:} |
+ {100:--- Signs ---} |
+ {18:Signs for [NULL]:} |
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>')
screen:expect([[
- {1:>>}^ |
- {0:~ }|*12
+ {10:>>}^ |
+ {1:~ }|*12
|
]])
end)
@@ -479,11 +468,11 @@ describe('Signs', function()
exec('2delete')
exec('sign unplace 10001')
screen:expect([[
- {2: }a |
- {2: }^c |
- {2: }d |
+ {7: }a |
+ {7: }^c |
+ {7: }d |
>>e |
- {0:~ }|*9
+ {1:~ }|*9
|
]])
exec('sign unplace 10002')
@@ -492,7 +481,7 @@ describe('Signs', function()
^c |
d |
e |
- {0:~ }|*9
+ {1:~ }|*9
|
]])
end)
@@ -505,13 +494,13 @@ describe('Signs', function()
exec('copy .')
exec('sign unplace 10001')
screen:expect([[
- {2: }a |
- {2: }^a |
- {2: }b |
- {2: }c |
- {2: }d |
+ {7: }a |
+ {7: }^a |
+ {7: }b |
+ {7: }c |
+ {7: }d |
>>e |
- {0:~ }|*7
+ {1:~ }|*7
|
]])
exec('sign unplace 10002')
@@ -522,7 +511,7 @@ describe('Signs', function()
c |
d |
e |
- {0:~ }|*7
+ {1:~ }|*7
|
]])
end)
@@ -537,9 +526,9 @@ describe('Signs', function()
call sign_place(0, '', 'foo', bufnr(''), { 'lnum':2 })
]])
screen:expect([[
- {8: 1 }^line1 |
- {8: 2 }line2 |
- {6: 3 }line3 |
+ {9: 1 }^line1 |
+ {9: 2 }line2 |
+ {8: 3 }line3 |
|
]])
end)
@@ -561,11 +550,11 @@ describe('Signs', function()
exec('norm 2Gdd')
exec('silent undo')
screen:expect([[
- {2: }1 |
+ {7: }1 |
S1^2 |
- {2: }3 |
- {2: }4 |
- {0:~ }|*9
+ {7: }3 |
+ {7: }4 |
+ {1:~ }|*9
|
]])
end)
@@ -590,7 +579,7 @@ describe('Signs', function()
local s1 = {
grid = [[
S2^ |
- {0:~ }|*12
+ {1:~ }|*12
|
]],
}
@@ -600,7 +589,7 @@ describe('Signs', function()
screen:expect({
grid = [[
S2S1^ |
- {0:~ }|*12
+ {1:~ }|*12
|
]],
})
diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua
index b4d4c94a5e..b225fa518d 100644
--- a/test/functional/ui/statuscolumn_spec.lua
+++ b/test/functional/ui/statuscolumn_spec.lua
@@ -235,30 +235,24 @@ describe('statuscolumn', function()
it('works with wrapped lines, signs and folds', function()
command([[set stc=%C%s%=%{v:virtnum?'':v:lnum}│\ ]])
command("call setline(1,repeat([repeat('aaaaa',10)],16))")
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = Screen.colors.Blue },
- [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 },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Red, background = Screen.colors.LightGray },
+ }
command('hi! CursorLine guifg=Red guibg=NONE')
screen:expect([[
- {1: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1: 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1: │ }a |
- {1:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}|
+ {8: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8: 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8: │ }a |
+ {8:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:@@@}|
|
]])
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 4 line=6 name=piet2 buffer=1')
screen:expect([[
- {1:>>}{2: }{1: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {0:>!}{2: }{1: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {0:>!}{1:>> 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {2: }{1: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {2: }{1: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {2: }{1: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │ }aaaaa |
- {2: }{1:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{0:@@@}|
+ {8:>>}{7: }{8: 4│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {1:>!}{7: }{8: 5│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {1:>!}{8:>> 6│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {7: }{8: 7│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {7: }{8: 8│ }^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {7: }{8: 9│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │ }aaaaa |
+ {7: }{8:10│ }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa{1:@@@}|
|
]])
command('norm zf$')
-- Check that alignment works properly with signs after %=
command([[set stc=%C%=%{v:virtnum?'':v:lnum}│%s\ ]])
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2:+}{1: 8│}{2: }{1: }{3:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 5│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 6│}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 7│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7:+}{8: 8│}{7: }{8: }{13:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{8: 9│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8:10│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
|
]])
command('set cursorline')
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2:+}{4: 8│}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
- {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 5│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 6│}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8: 7│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7:+}{15: 8│}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{8: 9│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
+ {7: }{8:10│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaa |
|
]])
-- v:lnum is the same value on wrapped lines
command([[set stc=%C%=%{v:lnum}│%s\ ]])
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 4│}{2: }{1: }aaaaaa |
- {2: }{1: 5│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 5│}{2: }{1: }aaaaaa |
- {2: }{1: 6│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 6│}{2: }{1: }aaaaaa |
- {2: }{1: 7│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 7│}{2: }{1: }aaaaaa |
- {2:+}{4: 8│}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{1: 9│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 9│}{2: }{1: }aaaaaa |
- {2: }{1:10│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1:10│}{2: }{1: }aaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 4│}{7: }{8: }aaaaaa |
+ {7: }{8: 5│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 5│}{7: }{8: }aaaaaa |
+ {7: }{8: 6│}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 6│}{7: }{8: }aaaaaa |
+ {7: }{8: 7│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 7│}{7: }{8: }aaaaaa |
+ {7:+}{15: 8│}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{8: 9│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 9│}{7: }{8: }aaaaaa |
+ {7: }{8:10│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8:10│}{7: }{8: }aaaaaa |
|
]])
-- v:relnum is the same value on wrapped lines
command([[set stc=%C%=\ %{v:relnum}│%s\ ]])
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 4│}{2: }{1: }aaaaaaa |
- {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 3│}{2: }{1: }aaaaaaa |
- {2: }{1: 2│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 2│}{2: }{1: }aaaaaaa |
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 1│}{2: }{1: }aaaaaaa |
- {2:+}{4: 0│}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 1│}{2: }{1: }aaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: 2│}{2: }{1: }aaaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 4│}{7: }{8: }aaaaaaa |
+ {7: }{8: 3│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 3│}{7: }{8: }aaaaaaa |
+ {7: }{8: 2│}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 2│}{7: }{8: }aaaaaaa |
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 1│}{7: }{8: }aaaaaaa |
+ {7:+}{15: 0│}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 1│}{7: }{8: }aaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: 2│}{7: }{8: }aaaaaaa |
|
]])
command([[set stc=%C%=\ %{v:virtnum?'':v:relnum}│%s\ ]])
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
- {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
- {2: }{1: 2│}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
- {2:+}{4: 0│}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
+ {7: }{8: 3│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
+ {7: }{8: 2│}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
+ {7:+}{15: 0│}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaa |
|
]])
-- 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 11 line=6 name=piet1 buffer=1')
screen:expect([[
- {2: }{1: 4│>>}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
- {2:+}{4: 0│}{2: }{4: }{6:^+-- 1 line: aaaaaaaaaaaaaaaa}|
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }{1: │}{2: }{1: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 4│>>}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 3│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
+ {7:+}{15: 0│}{7: }{15: }{100:^+-- 1 line: aaaaaaaaaaaaaaaa}|
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }{8: │}{7: }{8: }aaaaaaaaaaaaaaaaaaaaa |
|
]])
-- Also test fold and sign column when 'cpoptions' includes "n"
command('set cpoptions+=n')
feed('Hgjg0')
screen:expect([[
- {2: }{4: 0│}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{5:^aaaaaaaaaaaaaaaaaaaaa }|
- {2: }{1: 3│}{0:>!}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2:+}{1: 4│}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}|
- {2: }{1: 1│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{15: 0│}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{19:^aaaaaaaaaaaaaaaaaaaaa }|
+ {7: }{8: 3│}{1:>!}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7:+}{8: 4│}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
+ {7: }{8: 1│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
|
]])
command('set breakindent')
command('sign unplace 2')
feed('J2gjg0')
screen:expect([[
- {2: }{4: 0│}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: } {5:aaaaaaaaaaaaaaaaaaaaa aaaaaaa}|
- {2: } {5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: } {5:^aaaaaaaaaaaaaa }|
- {2: }{1: 1│>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: } aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: } aaaaaaaaaaaaaaaaaaaaa |
- {2:+}{1: 3│}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}|
- {2: }{1: 4│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: } aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 5│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: } aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{15: 0│}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: } {19:aaaaaaaaaaaaaaaaaaaaa aaaaaaa}|
+ {7: } {19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: } {19:^aaaaaaaaaaaaaa }|
+ {7: }{8: 1│>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: } aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: } aaaaaaaaaaaaaaaaaaaaa |
+ {7:+}{8: 3│}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
+ {7: }{8: 4│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: } aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 5│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: } aaaaaaaaaaaaaaaaaaaaa |
|
]])
command('set nobreakindent')
feed('$g0')
screen:expect([[
- {2: }{4: 0│}{1:>>}{2: }{4: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{5:aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa}|
- {2: }{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {2: }{5:^aaaa }|
- {2: }{1: 1│>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>>}{0:>!}{1:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 2│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2:+}{1: 3│}{2: }{1: }{3:+-- 1 line: aaaaaaaaaaaaaaaa}|
- {2: }{1: 4│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
- {2: }{1: 5│}{2: }{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {2: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{15: 0│}{8:>>}{7: }{15: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{19:aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaa}|
+ {7: }{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {7: }{19:^aaaa }|
+ {7: }{8: 1│>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>>}{1:>!}{8:>> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 2│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7:+}{8: 3│}{7: }{8: }{13:+-- 1 line: aaaaaaaaaaaaaaaa}|
+ {7: }{8: 4│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
+ {7: }{8: 5│}{7: }{8: }aaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {7: }aaaaaaaaaaaaaaaaaaaaa |
|
]])
command('silent undo')
@@ -467,38 +461,38 @@ describe('statuscolumn', function()
]])
command('set foldcolumn=0 signcolumn=number stc=%l')
screen:expect([[
- {1:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1: 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1: }virt_line |
- {1: }virt_line above |
- {1:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1: 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {4: 8}{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {1: 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1:10}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1:11}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1:12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1:13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
- {1:14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8: 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8: }virt_line |
+ {8: }virt_line above |
+ {8:>>}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8: 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {15: 8}{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {8: 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:10}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:11}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {8:14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
]])
command(
[[set stc=%{v:virtnum<0?'virtual':(!v:virtnum?'buffer':'wrapped')}%=%{'\ '.v:virtnum.'\ '.v:lnum}]]
)
screen:expect([[
- {1:buffer 0 4}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 4}aaaaaaaa |
- {1:buffer 0 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 5}aaaaaaaa |
- {1:virtual-2 5}virt_line |
- {1:virtual-1 5}virt_line above |
- {1:buffer 0 6}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 6}aaaaaaaa |
- {1:buffer 0 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 7}aaaaaaaa |
- {4:buffer 0 8}{6:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {1:buffer 0 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 9}aaaaaaaa |
+ {8:buffer 0 4}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 4}aaaaaaaa |
+ {8:buffer 0 5}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 5}aaaaaaaa |
+ {8:virtual-2 5}virt_line |
+ {8:virtual-1 5}virt_line above |
+ {8:buffer 0 6}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 6}aaaaaaaa |
+ {8:buffer 0 7}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 7}aaaaaaaa |
+ {15:buffer 0 8}{100:^+-- 1 line: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {8:buffer 0 9}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 9}aaaaaaaa |
|
]])
-- Also test virt_lines at the end of buffer
@@ -507,17 +501,17 @@ describe('statuscolumn', function()
]])
feed('GkJzz')
screen:expect([[
- {1:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 12}aaaaaaaaa |
- {1:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 13}aaaaaaaaa |
- {1:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 14}aaaaaaaaa |
- {4:buffer 0 15}{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {4:wrapped 1 15}{5:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {4:wrapped 2 15}{5:aaaaaaaaaaaaaaaaaaa }|
- {1:virtual-1 15}END |
- {0:~ }|*3
+ {8:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 12}aaaaaaaaa |
+ {8:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 13}aaaaaaaaa |
+ {8:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 14}aaaaaaaaa |
+ {15:buffer 0 15}{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {15:wrapped 1 15}{19:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {15:wrapped 2 15}{19:aaaaaaaaaaaaaaaaaaa }|
+ {8:virtual-1 15}END |
+ {1:~ }|*3
|
]])
-- 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", ""}}} })
]])
screen:expect([[
- {1:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:buffer 0 12}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa |
- {1:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:buffer 0 13}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa |
- {1:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:buffer 0 14}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
aaaaaaaaa |
- {4:buffer 0 15}{5:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {5:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
- {5:aaaaaaa }|
- {1:virtual-3 15}virt_line1 |
- {1:virtual-2 15}virt_line2 |
- {1:virtual-1 15}END |
- {0:~ }|
+ {15:buffer 0 15}{19:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {19:aaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}|
+ {19:aaaaaaa }|
+ {8:virtual-3 15}virt_line1 |
+ {8:virtual-2 15}virt_line2 |
+ {8:virtual-1 15}END |
+ {1:~ }|
|
]])
-- 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}
]])
screen:expect([[
- {1:buffer 0 12 3}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 12 3}aaaaaaaaaaa |
- {1:buffer 0 13 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 13 2}aaaaaaaaaaa |
- {1:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 14 1}aaaaaaaaaaa |
- {1:buffer 0 15 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 15 0}aaaaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 2 15 0}aaaaaaaaaaaaaaaaaaaaaaa |
- {1:virtual-3 15 0}virt_line1 |
- {1:virtual-2 15 0}virt_line2 |
- {1:virtual-1 15 0}END |
- {0:~ }|
+ {8:buffer 0 12 3}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 12 3}aaaaaaaaaaa |
+ {8:buffer 0 13 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 13 2}aaaaaaaaaaa |
+ {8:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 14 1}aaaaaaaaaaa |
+ {8:buffer 0 15 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 15 0}aaaaaaaaaaa^ aaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 2 15 0}aaaaaaaaaaaaaaaaaaaaaaa |
+ {8:virtual-3 15 0}virt_line1 |
+ {8:virtual-2 15 0}virt_line2 |
+ {8:virtual-1 15 0}END |
+ {1:~ }|
|
]])
feed('kk')
screen:expect([[
- {1:buffer 0 12 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 12 1}aaaaaaaaaaa |
- {1:buffer 0 13 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 13 0}aaaaaaaaaa^a |
- {1:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 14 1}aaaaaaaaaaa |
- {1:buffer 0 15 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 1 15 2}aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa|
- {1:wrapped 2 15 2}aaaaaaaaaaaaaaaaaaaaaaa |
- {1:virtual-3 15 2}virt_line1 |
- {1:virtual-2 15 2}virt_line2 |
- {1:virtual-1 15 2}END |
- {0:~ }|
+ {8:buffer 0 12 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 12 1}aaaaaaaaaaa |
+ {8:buffer 0 13 0}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 13 0}aaaaaaaaaa^a |
+ {8:buffer 0 14 1}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 14 1}aaaaaaaaaaa |
+ {8:buffer 0 15 2}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 1 15 2}aaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaa|
+ {8:wrapped 2 15 2}aaaaaaaaaaaaaaaaaaaaaaa |
+ {8:virtual-3 15 2}virt_line1 |
+ {8:virtual-2 15 2}virt_line2 |
+ {8:virtual-1 15 2}END |
+ {1:~ }|
|
]])
end)
@@ -680,10 +674,6 @@ describe('statuscolumn', function()
it('popupmenu callback does not drag mouse on close', function()
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', {})
exec([[
function! MyClickFunc(minwid, clicks, button, mods)
@@ -695,26 +685,26 @@ describe('statuscolumn', function()
-- clicking an item does not drag mouse
api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[
- {0: 8}^aaaaa |
- {1: Echo } |
+ {8: 8}^aaaaa |
+ {4: Echo } |
]])
api.nvim_input_mouse('left', 'press', '', 0, 1, 5)
api.nvim_input_mouse('left', 'release', '', 0, 1, 5)
screen:expect([[
- {0: 8}^aaaaa |
+ {8: 8}^aaaaa |
0 1 l 8 |
]])
command('echo')
-- clicking outside to close the menu does not drag mouse
api.nvim_input_mouse('left', 'press', '', 0, 0, 0)
screen:expect([[
- {0: 8}^aaaaa |
- {1: Echo } |
+ {8: 8}^aaaaa |
+ {4: Echo } |
]])
api.nvim_input_mouse('left', 'press', '', 0, 0, 10)
api.nvim_input_mouse('left', 'release', '', 0, 0, 10)
screen:expect([[
- {0: 8}^aaaaa |
+ {8: 8}^aaaaa |
|
]])
end)
@@ -943,16 +933,15 @@ describe('statuscolumn', function()
it('does not wrap multibyte characters at the end of a line', function()
screen:try_resize(33, 4)
- screen:set_default_attr_ids {
- [8] = { foreground = Screen.colors.Brown },
- [31] = { undercurl = true, special = Screen.colors.Red },
+ screen:add_extra_attr_ids {
+ [100] = { undercurl = true, special = Screen.colors.Red },
}
command([[set spell stc=%l\ ]])
command('call setline(8, "This is a line that contains ᶏ multibyte character.")')
screen:expect([[
- {8: 8 }^This is a line that contains {31:ᶏ}|
- {8: } {31:multibyte} character. |
- {8: 9 }{31:aaaaa} |
+ {8: 8 }^This is a line that contains {100:ᶏ}|
+ {8: } {100:multibyte} character. |
+ {8: 9 }{100:aaaaa} |
|
]])
end)
diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua
index 001d927cb1..d628d7b1d7 100644
--- a/test/functional/ui/statusline_spec.lua
+++ b/test/functional/ui/statusline_spec.lua
@@ -24,11 +24,9 @@ for _, model in ipairs(mousemodels) do
before_each(function()
clear()
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] = { bold = true, foreground = Screen.colors.Blue, reverse = true }, -- NonText combined with StatusLine
- })
+ screen:add_extra_attr_ids {
+ [100] = { bold = true, reverse = true, foreground = Screen.colors.Blue },
+ }
screen:attach()
command('set laststatus=2 mousemodel=' .. model)
exec([=[
@@ -87,8 +85,8 @@ for _, model in ipairs(mousemodels) do
screen:expect {
grid = [[
^ |
- {0:~ }|*5
- {1:^I}{2:^A^I^A^I}{1:^A }|
+ {1:~ }|*5
+ {3:^I}{100:^A^I^A^I}{3:^A }|
|
]],
}
@@ -211,8 +209,8 @@ for _, model in ipairs(mousemodels) do
screen:expect {
grid = [[
^ │ |
- {0:~ }│{0:~ }|*5
- {1:Clicky stuff Clicky stuff}|
+ {1:~ }│{1:~ }|*5
+ {3:Clicky stuff Clicky stuff}|
|
]],
}
@@ -257,13 +255,9 @@ describe('global statusline', function()
clear()
screen = Screen.new(60, 16)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue },
- [2] = { bold = true, reverse = true },
- [3] = { bold = true },
- [4] = { reverse = true },
- [5] = { bold = true, foreground = Screen.colors.Fuchsia },
- })
+ screen:add_extra_attr_ids {
+ [100] = { foreground = Screen.colors.Magenta1, bold = true },
+ }
command('set laststatus=3')
command('set ruler')
end)
@@ -272,7 +266,7 @@ describe('global statusline', function()
screen:expect([[
^ |
{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
^ |
{1:~ }|*11
- {2:[No Name] [+] 3,1 All}|
- {3:-- INSERT --} |
+ {3:[No Name] [+] 3,1 All}|
+ {5:-- INSERT --} |
]])
end)
@@ -299,7 +293,7 @@ describe('global statusline', function()
────────────────────┴────────────────┴─┤{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|*3
- {2:[No Name] 0,0-1 All}|
+ {3:[No Name] 0,0-1 All}|
|
]])
end)
@@ -316,7 +310,7 @@ describe('global statusline', function()
screen:expect([[
^ |
{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([[
│ │ │^ |
{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:~}│{2:<No Name] 0,0-1 All}|
+ {1:~ }│{1:~ }│{1:~}│{3:<No Name] 0,0-1 All}|
{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:~ }|*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:~ }|*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([[
│ │ │^ |
{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:~}│{2:<No Name] 0,0-1 All}|
+ {1:~ }│{1:~ }│{1:~}│{3:<No Name] 0,0-1 All}|
{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:~ }|*4
0,0-1 All |
@@ -380,7 +374,7 @@ describe('global statusline', function()
────────────────────┴────────────────┴─┤{1:~ }|
│{1:~ }|
{1:~ }│{1:~ }|*3
- {2:[No Name] 0,0-1 All}|
+ {3:[No Name] 0,0-1 All}|
|
]])
end)
@@ -430,7 +424,7 @@ describe('global statusline', function()
0004;<control>;Cc;0;BN;;;;;N;END OF TRANSMISSION;;;; |
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
^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')
@@ -445,12 +439,12 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^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, {})
screen:expect([[
- {3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
+ {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
|
{1:~ }|*5
────────────────────────────────────────────────────────────|
@@ -460,12 +454,12 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^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, {})
screen:expect([[
- {3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
+ {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
|
{1:~ }|*5
────────────────────────────────────────────────────────────|
@@ -476,11 +470,11 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^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, {})
screen:expect([[
- {3: }{5:2}{3: t/f/f/bigfile.txt }{4: }|
+ {5: }{100:2}{5: t/f/f/bigfile.txt }{2: }|
|
{1:~ }|*5
────────────────────────────────────────────────────────────|
@@ -490,7 +484,7 @@ describe('global statusline', function()
0005;<control>;Cc;0;BN;;;;;N;ENQUIRY;;;; |
0006;<control>;Cc;0;BN;;;;;N;ACKNOWLEDGE;;;; |
^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)
@@ -509,7 +503,7 @@ describe('global statusline', function()
────────────────────────────────────────────────────────────|
^ |
{1:~ }|*6
- {2:[No Name] 0,0-1 All}|
+ {3:[No Name] 0,0-1 All}|
|
]])
end)
@@ -526,10 +520,6 @@ end)
it('statusline is redrawn with :resize from <Cmd> mapping #19629', function()
clear()
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()
exec([[
set laststatus=2
@@ -539,15 +529,15 @@ it('statusline is redrawn with :resize from <Cmd> mapping #19629', function()
feed('<Up>')
screen:expect([[
^ |
- {0:~ }|*4
- {1:[No Name] }|
+ {1:~ }|*4
+ {3:[No Name] }|
|*2
]])
feed('<Down>')
screen:expect([[
^ |
- {0:~ }|*5
- {1:[No Name] }|
+ {1:~ }|*5
+ {3:[No Name] }|
|
]])
end)
@@ -555,19 +545,14 @@ end)
it('showcmdloc=statusline does not show if statusline is too narrow', function()
clear()
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()
command('set showcmd')
command('set showcmdloc=statusline')
command('1vsplit')
screen:expect([[
^ │ |
- {0:~}│{0:~ }|*5
- {1:< }{2:[No Name] }|
+ {1:~}│{1:~ }|*5
+ {3:< }{2:[No Name] }|
|
]])
feed('1234')
@@ -692,11 +677,6 @@ end)
it('shows correct ruler in cmdline with no statusline', function()
clear()
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()
-- Use long ruler to check 'ruler' with 'rulerformat' set has correct width.
command [[
@@ -714,7 +694,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[
^ |
{1:~ }|*2
- {2:[No Name] 1longlonglong }|
+ {3:[No Name] 1longlonglong }|
│ |
{1:~ }│{1:~ }|*2
3longlonglong |
@@ -725,7 +705,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[
|
{1:~ }|*2
- {3:[No Name] 1longlonglong }|
+ {2:[No Name] 1longlonglong }|
^ │ |
{1:~ }│{1:~ }|*2
2longlonglong |
@@ -735,7 +715,7 @@ it('shows correct ruler in cmdline with no statusline', function()
screen:expect [[
|
{1:~ }|*2
- {3:[No Name] 1longlonglong }|
+ {2:[No Name] 1longlonglong }|
│^ |
{1:~ }│{1:~ }|*2
3longlonglong |
@@ -746,9 +726,6 @@ it('uses "stl" and "stlnc" fillchars even if they are the same #19803', function
clear()
local screen = Screen.new(53, 4)
screen:attach()
- screen:set_default_attr_ids({
- [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
- })
command('hi clear StatusLine')
command('hi clear StatusLineNC')
command('vsplit')
@@ -765,11 +742,6 @@ end)
it('showcmdloc=statusline works with vertical splits', function()
clear()
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()
command('rightbelow vsplit')
command('set showcmd showcmdloc=statusline')
@@ -777,7 +749,7 @@ it('showcmdloc=statusline works with vertical splits', function()
screen:expect([[
│^ |
{1:~ }│{1:~ }|
- {3:[No Name] }{2:[No Name] 1234 }|
+ {2:[No Name] }{3:[No Name] 1234 }|
|
]])
feed('<Esc>')
@@ -786,7 +758,7 @@ it('showcmdloc=statusline works with vertical splits', function()
screen:expect([[
│^ |
{1:~ }│{1:~ }|
- {2:[No Name] 1234 }|
+ {3:[No Name] 1234 }|
|
]])
end)
@@ -794,25 +766,20 @@ end)
it('keymap is shown with vertical splits #27269', function()
clear()
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()
command('setlocal keymap=dvorak')
command('rightbelow vsplit')
screen:expect([[
│^ |
{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')
screen:expect([[
│^ |
{1:~ }│{1:~ }|
- {2:[No Name] <en-dv> }|
+ {3:[No Name] <en-dv> }|
|
]])
end)