aboutsummaryrefslogtreecommitdiff
path: root/test
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 /test
parentd0e78b587195d201d643f3e131dd1ea951d906db (diff)
downloadrneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.gz
rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.tar.bz2
rneovim-29fd5ed606bccab28faaa55fd772704f7ca7d315.zip
refactor(tests): use more global highlight definitions
Diffstat (limited to 'test')
-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 --}