aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/bufhl_spec.lua191
-rw-r--r--test/functional/ui/highlight_spec.lua359
-rw-r--r--test/functional/ui/mouse_spec.lua326
-rw-r--r--test/functional/ui/output_spec.lua22
-rw-r--r--test/functional/ui/screen.lua6
-rw-r--r--test/functional/ui/screen_basic_spec.lua432
-rw-r--r--test/functional/ui/searchhl_spec.lua197
-rw-r--r--test/functional/ui/sign_spec.lua32
-rw-r--r--test/functional/ui/syntax_conceal_spec.lua130
-rw-r--r--test/functional/ui/wildmode_spec.lua8
10 files changed, 853 insertions, 850 deletions
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index f91aa8d402..a8006e1ac6 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -8,30 +8,21 @@ describe('Buffer highlighting', function()
local screen
local curbuf
- local hl_colors = {
- NonText = Screen.colors.Blue,
- Question = Screen.colors.SeaGreen,
- String = Screen.colors.Fuchsia,
- Statement = Screen.colors.Brown,
- Special = Screen.colors.SlateBlue,
- Identifier = Screen.colors.DarkCyan
- }
-
before_each(function()
clear()
execute("syntax on")
screen = Screen.new(40, 8)
screen:attach()
- screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} )
screen:set_default_attr_ids({
- [1] = {foreground = hl_colors.String},
- [2] = {foreground = hl_colors.Statement, bold = true},
- [3] = {foreground = hl_colors.Special},
- [4] = {bold = true, foreground = hl_colors.Special},
- [5] = {foreground = hl_colors.Identifier},
- [6] = {bold = true},
- [7] = {underline = true, bold = true, foreground = hl_colors.Special},
- [8] = {foreground = hl_colors.Special, underline = true}
+ [1] = {bold=true, foreground=Screen.colors.Blue},
+ [2] = {foreground = Screen.colors.Fuchsia}, -- String
+ [3] = {foreground = Screen.colors.Brown, bold = true}, -- Statement
+ [4] = {foreground = Screen.colors.SlateBlue}, -- Special
+ [5] = {bold = true, foreground = Screen.colors.SlateBlue},
+ [6] = {foreground = Screen.colors.DarkCyan}, -- Identifier
+ [7] = {bold = true},
+ [8] = {underline = true, bold = true, foreground = Screen.colors.SlateBlue},
+ [9] = {foreground = Screen.colors.SlateBlue, underline = true}
})
curbuf = request('vim_get_current_buffer')
end)
@@ -58,11 +49,11 @@ describe('Buffer highlighting', function()
screen:expect([[
these are some lines |
with colorful tex^t |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
@@ -70,25 +61,25 @@ describe('Buffer highlighting', function()
add_hl(-1, "Statement", 1 , 5, -1)
screen:expect([[
- these are {1:some} lines |
- with {2:colorful tex^t} |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ these are {2:some} lines |
+ with {3:colorful tex^t} |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
feed("ggo<esc>")
screen:expect([[
- these are {1:some} lines |
+ these are {2:some} lines |
^ |
- with {2:colorful text} |
- ~ |
- ~ |
- ~ |
- ~ |
+ with {3:colorful text} |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
@@ -97,10 +88,10 @@ describe('Buffer highlighting', function()
these are some lines |
^ |
with colorful text |
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
end)
@@ -128,13 +119,13 @@ describe('Buffer highlighting', function()
neq(id1, id2)
screen:expect([[
- a {4:longer} example |
- in {5:order} to {6:de}{4:monstr}{6:ate} |
- {6:combin}{7:ing}{8: hi}ghlights |
- {8:from }{7:diff}{6:erent} source^s |
- ~ |
- ~ |
- ~ |
+ a {5:longer} example |
+ in {6:order} to {7:de}{5:monstr}{7:ate} |
+ {7:combin}{8:ing}{9: hi}ghlights |
+ {9:from }{8:diff}{7:erent} source^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:hi ImportantWord gui=bold cterm=bold |
]])
end)
@@ -142,13 +133,13 @@ describe('Buffer highlighting', function()
it('and clearing the first added', function()
clear_hl(id1, 0, -1)
screen:expect([[
- a {3:longer} example |
- in {5:order} to de{3:monstr}ate |
- combin{8:ing hi}ghlights |
- {8:from diff}erent source^s |
- ~ |
- ~ |
- ~ |
+ a {4:longer} example |
+ in {6:order} to de{4:monstr}ate |
+ combin{9:ing hi}ghlights |
+ {9:from diff}erent source^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:hi ImportantWord gui=bold cterm=bold |
]])
end)
@@ -156,13 +147,13 @@ describe('Buffer highlighting', function()
it('and clearing the second added', function()
clear_hl(id2, 0, -1)
screen:expect([[
- a {6:longer} example |
- in order to {6:demonstrate} |
- {6:combining} highlights |
- from {6:different} source^s |
- ~ |
- ~ |
- ~ |
+ a {7:longer} example |
+ in order to {7:demonstrate} |
+ {7:combining} highlights |
+ from {7:different} source^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:hi ImportantWord gui=bold cterm=bold |
]])
end)
@@ -173,12 +164,12 @@ describe('Buffer highlighting', function()
clear_hl(id2, 2, -1)
screen:expect([[
a longer example |
- in {5:order} to de{3:monstr}ate |
- {6:combining} highlights |
- from {6:different} source^s |
- ~ |
- ~ |
- ~ |
+ in {6:order} to de{4:monstr}ate |
+ {7:combining} highlights |
+ from {7:different} source^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:hi ImportantWord gui=bold cterm=bold |
]])
end)
@@ -186,25 +177,25 @@ describe('Buffer highlighting', function()
it('and renumbering lines', function()
feed('3Gddggo<esc>')
screen:expect([[
- a {4:longer} example |
+ a {5:longer} example |
^ |
- in {5:order} to {6:de}{4:monstr}{6:ate} |
- {8:from }{7:diff}{6:erent} sources |
- ~ |
- ~ |
- ~ |
+ in {6:order} to {7:de}{5:monstr}{7:ate} |
+ {9:from }{8:diff}{7:erent} sources |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
execute(':3move 4')
screen:expect([[
- a {4:longer} example |
+ a {5:longer} example |
|
- {8:from }{7:diff}{6:erent} sources |
- ^in {5:order} to {6:de}{4:monstr}{6:ate} |
- ~ |
- ~ |
- ~ |
+ {9:from }{8:diff}{7:erent} sources |
+ ^in {6:order} to {7:de}{5:monstr}{7:ate} |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
::3move 4 |
]])
end)
@@ -218,25 +209,25 @@ describe('Buffer highlighting', function()
local id = add_hl(0, "Special", 0, 0, 9)
screen:expect([[
- {3:three ove}{5:rlapp}{1:ing color}^s |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {4:three ove}{6:rlapp}{2:ing color}^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
clear_hl(id, 0, 1)
screen:expect([[
- three {5:overlapp}{1:ing color}^s |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ three {6:overlapp}{2:ing color}^s |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
end)
@@ -248,13 +239,13 @@ describe('Buffer highlighting', function()
add_hl(-1, "String", 0, 16, 21)
screen:expect([[
- Ta {5:båten} över {1:sjön}^! |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ Ta {6:båten} över {2:sjön}^! |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
|
]])
end)
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 6ef40fff62..46c0964a67 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -27,10 +27,11 @@ describe('manual syntax highlight', function()
clear()
screen = Screen.new(20,5)
screen:attach()
- --ignore highligting of ~-lines
- screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
--syntax highlight for vimcscripts "echo"
- screen:set_default_attr_ids( {[1] = {bold=true, foreground=Screen.colors.Brown}} )
+ screen:set_default_attr_ids( {
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {bold=true, foreground=Screen.colors.Brown}
+ } )
end)
after_each(function()
@@ -53,9 +54,9 @@ describe('manual syntax highlight', function()
execute('bp')
screen:expect([[
{1:^echo} 1 |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
<f 1 --100%-- col 1 |
]])
end)
@@ -75,9 +76,9 @@ describe('manual syntax highlight', function()
execute('bp')
screen:expect([[
{1:^echo} 1 |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
<ht.tmp.vim" 1L, 7C |
]])
end)
@@ -89,17 +90,10 @@ describe('Default highlight groups', function()
-- command
local screen
- local hlgroup_colors = {
- NonText = Screen.colors.Blue,
- Question = Screen.colors.SeaGreen
- }
-
before_each(function()
clear()
screen = Screen.new()
screen:attach()
- --ignore highligting of ~-lines
- screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} )
end)
after_each(function()
@@ -108,23 +102,24 @@ describe('Default highlight groups', function()
it('window status bar', function()
screen:set_default_attr_ids({
+ [0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {reverse = true, bold = true}, -- StatusLine
[2] = {reverse = true} -- StatusLineNC
})
execute('sp', 'vsp', 'vsp')
screen:expect([[
^ {2:|} {2:|} |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
{1:[No Name] }{2:[No Name] [No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{2:[No Name] }|
|
]])
@@ -132,17 +127,17 @@ describe('Default highlight groups', function()
feed('<c-w>j')
screen:expect([[
{2:|} {2:|} |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
{2:[No Name] [No Name] [No Name] }|
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{1:[No Name] }|
|
]])
@@ -152,51 +147,51 @@ describe('Default highlight groups', function()
feed('<c-w>k<c-w>l')
screen:expect([[
{2:|}^ {2:|} |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
{2:[No Name] }{1:[No Name] }{2:[No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{2:[No Name] }|
|
]])
feed('<c-w>l')
screen:expect([[
{2:|} {2:|}^ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
{2:[No Name] [No Name] }{1:[No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{2:[No Name] }|
|
]])
feed('<c-w>h<c-w>h')
screen:expect([[
^ {2:|} {2:|} |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
- ~ {2:|}~ {2:|}~ |
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
+ {0:~ }{2:|}{0:~ }{2:|}{0:~ }|
{1:[No Name] }{2:[No Name] [No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{2:[No Name] }|
|
]])
@@ -206,20 +201,21 @@ describe('Default highlight groups', function()
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{1:-- INSERT --} |
- ]], {[1] = {bold = true}})
+ ]], {[0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {bold = true}})
end)
it('end of file markers', function()
@@ -238,27 +234,28 @@ describe('Default highlight groups', function()
{1:~ }|
{1:~ }|
|
- ]], {[1] = {bold = true, foreground = hlgroup_colors.NonText}})
+ ]], {[1] = {bold = true, foreground = Screen.colors.Blue}})
end)
it('"wait return" text', function()
feed(':ls<cr>')
screen:expect([[
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:ls |
1 %a "[No Name]" line 1 |
{1:Press ENTER or type command to continue}^ |
- ]], {[1] = {bold = true, foreground = hlgroup_colors.Question}})
+ ]], {[0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {bold = true, foreground = Screen.colors.SeaGreen}})
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
end)
it('can be cleared and linked to other highlight groups', function()
@@ -266,40 +263,42 @@ describe('Default highlight groups', function()
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
-- INSERT -- |
- ]], {})
+ ]], {[0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {bold=true}})
feed('<esc>')
execute('highlight CustomHLGroup guifg=red guibg=green')
execute('highlight link ModeMsg CustomHLGroup')
feed('i')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
{1:-- INSERT --} |
- ]], {[1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}})
+ ]], {[0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {foreground = Screen.colors.Red, background = Screen.colors.Green}})
end)
it('can be cleared by assigning NONE', function()
execute('syn keyword TmpKeyword neovim')
@@ -307,40 +306,41 @@ describe('Default highlight groups', function()
insert('neovim')
screen:expect([[
{1:neovi^m} |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
]], {
+ [0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {foreground = Screen.colors.White, background = Screen.colors.Red}
})
execute("hi ErrorMsg term=NONE cterm=NONE ctermfg=NONE ctermbg=NONE"
.. " gui=NONE guifg=NONE guibg=NONE guisp=NONE")
screen:expect([[
neovi^m |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], {})
+ ]], {[0] = {bold=true, foreground=Screen.colors.Blue}})
end)
end)
@@ -351,10 +351,6 @@ describe('guisp (special/undercurl)', function()
clear()
screen = Screen.new(25,10)
screen:attach()
- screen:set_default_attr_ignore({
- [1] = {bold = true, foreground = Screen.colors.Blue},
- [2] = {bold = true}
- })
end)
it('can be set and is applied like foreground or background', function()
@@ -389,14 +385,16 @@ describe('guisp (special/undercurl)', function()
{4:specialwithfg} |
|
{1:neovim} tabbed^ |
- ~ |
- -- INSERT -- |
+ {0:~ }|
+ {5:-- INSERT --} |
]],{
+ [0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {background = Screen.colors.Yellow, foreground = Screen.colors.Red,
special = Screen.colors.Red},
[2] = {special = Screen.colors.Red},
[3] = {special = Screen.colors.Red, background = Screen.colors.Yellow},
[4] = {foreground = Screen.colors.Red, special = Screen.colors.Red},
+ [5] = {bold=true},
})
end)
@@ -405,13 +403,6 @@ end)
describe("'cursorline' with 'listchars'", function()
local screen
- local hlgroup_colors = {
- NonText = Screen.colors.Blue,
- Cursorline = Screen.colors.Grey90,
- SpecialKey = Screen.colors.Red,
- Visual = Screen.colors.LightGrey,
- }
-
before_each(function()
clear()
screen = Screen.new(20,5)
@@ -423,48 +414,50 @@ describe("'cursorline' with 'listchars'", function()
end)
it("'cursorline' and 'cursorcolumn'", function()
- screen:set_default_attr_ids({[1] = {background=hlgroup_colors.Cursorline}})
- screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} )
+ screen:set_default_attr_ids({
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {background=Screen.colors.Grey90}
+ })
execute('highlight clear ModeMsg')
execute('set cursorline')
feed('i')
screen:expect([[
{1:^ }|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
-- INSERT -- |
]])
feed('abcdefg<cr>kkasdf')
screen:expect([[
abcdefg |
{1:kkasdf^ }|
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
-- INSERT -- |
]])
feed('<esc>')
screen:expect([[
abcdefg |
{1:kkasd^f }|
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
]])
execute('set nocursorline')
screen:expect([[
abcdefg |
kkasd^f |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:set nocursorline |
]])
feed('k')
screen:expect([[
abcde^fg |
kkasdf |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:set nocursorline |
]])
feed('jjji<cr><cr><cr><esc>')
@@ -497,22 +490,22 @@ describe("'cursorline' with 'listchars'", function()
it("'cursorline' and with 'listchar' option: space, eol, tab, and trail", function()
screen:set_default_attr_ids({
- [1] = {background=hlgroup_colors.Cursorline},
+ [1] = {background=Screen.colors.Grey90},
[2] = {
- foreground=hlgroup_colors.SpecialKey,
- background=hlgroup_colors.Cursorline,
+ foreground=Screen.colors.Red,
+ background=Screen.colors.Grey90,
},
[3] = {
- background=hlgroup_colors.Cursorline,
- foreground=hlgroup_colors.NonText,
+ background=Screen.colors.Grey90,
+ foreground=Screen.colors.Blue,
bold=true,
},
[4] = {
- foreground=hlgroup_colors.NonText,
+ foreground=Screen.colors.Blue,
bold=true,
},
[5] = {
- foreground=hlgroup_colors.SpecialKey,
+ foreground=Screen.colors.Red,
},
})
execute('highlight clear ModeMsg')
@@ -581,33 +574,33 @@ describe("'cursorline' with 'listchars'", function()
it("'listchar' in visual mode", function()
screen:set_default_attr_ids({
- [1] = {background=hlgroup_colors.Cursorline},
+ [1] = {background=Screen.colors.Grey90},
[2] = {
- foreground=hlgroup_colors.SpecialKey,
- background=hlgroup_colors.Cursorline,
+ foreground=Screen.colors.Red,
+ background=Screen.colors.Grey90,
},
[3] = {
- background=hlgroup_colors.Cursorline,
- foreground=hlgroup_colors.NonText,
+ background=Screen.colors.Grey90,
+ foreground=Screen.colors.Blue,
bold=true,
},
[4] = {
- foreground=hlgroup_colors.NonText,
+ foreground=Screen.colors.Blue,
bold=true,
},
[5] = {
- foreground=hlgroup_colors.SpecialKey,
+ foreground=Screen.colors.Red,
},
[6] = {
- background=hlgroup_colors.Visual,
+ background=Screen.colors.LightGrey,
},
[7] = {
- background=hlgroup_colors.Visual,
- foreground=hlgroup_colors.SpecialKey,
+ background=Screen.colors.LightGrey,
+ foreground=Screen.colors.Red,
},
[8] = {
- background=hlgroup_colors.Visual,
- foreground=hlgroup_colors.NonText,
+ background=Screen.colors.LightGrey,
+ foreground=Screen.colors.Blue,
bold=true,
},
})
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index fd6c62a6f6..3f6d8e4663 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -7,11 +7,6 @@ local eq, funcs = helpers.eq, helpers.funcs
describe('Mouse input', function()
local screen
- local hlgroup_colors = {
- NonText = Screen.colors.Blue,
- Visual = Screen.colors.LightGrey
- }
-
before_each(function()
clear()
meths.set_option('mouse', 'a')
@@ -22,21 +17,23 @@ describe('Mouse input', function()
screen = Screen.new(25, 5)
screen:attach()
screen:set_default_attr_ids({
- [1] = {background = hlgroup_colors.Visual},
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {background = Screen.colors.LightGrey},
[2] = {bold = true},
[3] = {
- foreground = hlgroup_colors.NonText,
- background = hlgroup_colors.Visual,
+ foreground = Screen.colors.Blue,
+ background = Screen.colors.LightGrey,
bold = true,
},
+ [4] = {reverse = true},
+ [5] = {bold = true, reverse = true},
})
- screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} )
feed('itesting<cr>mouse<cr>support and selection<esc>')
screen:expect([[
testing |
mouse |
support and selectio^n |
- ~ |
+ {0:~ }|
|
]])
end)
@@ -51,7 +48,7 @@ describe('Mouse input', function()
testing |
mo^use |
support and selection |
- ~ |
+ {0:~ }|
|
]])
feed('<LeftMouse><0,0>')
@@ -59,7 +56,7 @@ describe('Mouse input', function()
^testing |
mouse |
support and selection |
- ~ |
+ {0:~ }|
|
]])
end)
@@ -73,7 +70,7 @@ describe('Mouse input', function()
{1:testin}^g |
mouse |
support and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
end)
@@ -89,7 +86,7 @@ describe('Mouse input', function()
^t{1:esting}{3: } |
mouse |
support and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL LINE --} |
]])
end)
@@ -107,17 +104,20 @@ describe('Mouse input', function()
^testing |
mouse |
support and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL BLOCK --} |
]])
end)
describe('tabline', function()
- local tab_attrs = {
- tab = { background=Screen.colors.LightGrey, underline=true },
- sel = { bold=true },
- fill = { reverse=true }
- }
+ 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 (position 4) switches to tab', function()
execute('%delete')
@@ -127,18 +127,18 @@ describe('Mouse input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
feed('<LeftMouse><4,0>')
screen:expect([[
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
this is fo^o |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
end)
it('left click in default tabline (position 24) closes tab', function()
@@ -150,18 +150,18 @@ describe('Mouse input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
feed('<LeftMouse><24,0>')
screen:expect([[
this is fo^o |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
end)
it('double click in default tabline (position 4) opens new tab', function()
@@ -173,18 +173,18 @@ describe('Mouse input', function()
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
this is ba^r |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
feed('<2-LeftMouse><4,0>')
screen:expect([[
{sel: Name] }{tab: + foo + bar }{fill: }{tab:X}|
^ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
end)
describe('%@ label', function()
@@ -206,9 +206,9 @@ describe('Mouse input', function()
{fill:test-test2 }|
mouse |
support and selectio^n |
- ~ |
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
meths.set_var('reply', {})
end)
@@ -264,7 +264,7 @@ describe('Mouse input', function()
testing |
mo^use |
support and selection |
- ~ |
+ {0:~ }|
|
]])
feed('<LeftDrag><4,1>')
@@ -272,7 +272,7 @@ describe('Mouse input', function()
testing |
mo{1:us}^e |
support and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
feed('<LeftDrag><2,2>')
@@ -280,7 +280,7 @@ describe('Mouse input', function()
testing |
mo{1:use}{3: } |
{1:su}^pport and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
feed('<LeftDrag><0,0>')
@@ -288,18 +288,19 @@ describe('Mouse input', function()
^t{1:esting}{3: } |
{1:mou}se |
support and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
end)
it('left drag changes visual selection after tab click', function()
- local tab_attrs = {
+ 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 }
- }
+ })
execute('silent file foo | tabnew | file bar')
insert('this is bar')
execute('tabprevious') -- go to first tab
@@ -307,27 +308,27 @@ describe('Mouse input', function()
{sel: + foo }{tab: + bar }{fill: }{tab:X}|
mouse |
support and selectio^n |
- ~ |
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
feed('<LeftMouse><10,0><LeftRelease>') -- go to second tab
helpers.wait()
feed('<LeftMouse><0,1>')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
^this is bar |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
|
- ]], tab_attrs)
+ ]])
feed('<LeftDrag><4,1>')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
{vis:this}^ is bar |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
{sel:-- VISUAL --} |
- ]], tab_attrs)
+ ]])
end)
it('two clicks will select the word and enter VISUAL', function()
@@ -336,7 +337,7 @@ describe('Mouse input', function()
testing |
mouse |
{1:suppor}^t and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
end)
@@ -347,7 +348,7 @@ describe('Mouse input', function()
testing |
mouse |
{1:su}^p{1:port and selection}{3: } |
- ~ |
+ {0:~ }|
{2:-- VISUAL LINE --} |
]])
end)
@@ -358,7 +359,7 @@ describe('Mouse input', function()
testing |
mouse |
su^pport and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL BLOCK --} |
]])
end)
@@ -369,7 +370,7 @@ describe('Mouse input', function()
^testing |
mouse |
support and selection |
- ~ |
+ {0:~ }|
|
]])
feed('<RightMouse><2,2>')
@@ -377,7 +378,7 @@ describe('Mouse input', function()
{1:testing}{3: } |
{1:mouse}{3: } |
{1:su}^pport and selection |
- ~ |
+ {0:~ }|
{2:-- VISUAL --} |
]])
end)
@@ -409,73 +410,71 @@ describe('Mouse input', function()
]])
screen:try_resize(53, 14)
execute('sp', 'vsp')
- screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText},
- {reverse=true}, {bold=true, reverse=true}} )
screen:expect([[
- lines |lines |
- to |to |
- test |test |
- mouse scrolling |mouse scrolling |
- ^ | |
- ~ |~ |
- [No Name] [+] [No Name] [+] |
+ lines {4:|}lines |
+ to {4:|}to |
+ test {4:|}test |
+ mouse scrolling {4:|}mouse scrolling |
+ ^ {4:|} |
+ {0:~ }{4:|}{0:~ }|
+ {5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {4:[No Name] [+] }|
:vsp |
]])
feed('<MouseUp><0,0>')
screen:expect([[
- mouse scrolling |lines |
- ^ |to |
- ~ |test |
- ~ |mouse scrolling |
- ~ | |
- ~ |~ |
- [No Name] [+] [No Name] [+] |
+ mouse scrolling {4:|}lines |
+ ^ {4:|}to |
+ {0:~ }{4:|}test |
+ {0:~ }{4:|}mouse scrolling |
+ {0:~ }{4:|} |
+ {0:~ }{4:|}{0:~ }|
+ {5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {4:[No Name] [+] }|
|
]])
feed('<MouseDown><27,0>')
screen:expect([[
- mouse scrolling |text |
- ^ |with |
- ~ |many |
- ~ |lines |
- ~ |to |
- ~ |test |
- [No Name] [+] [No Name] [+] |
+ mouse scrolling {4:|}text |
+ ^ {4:|}with |
+ {0:~ }{4:|}many |
+ {0:~ }{4:|}lines |
+ {0:~ }{4:|}to |
+ {0:~ }{4:|}test |
+ {5:[No Name] [+] }{4:[No Name] [+] }|
to |
test |
mouse scrolling |
|
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {4:[No Name] [+] }|
|
]])
feed('<MouseDown><27,7><MouseDown>')
screen:expect([[
- mouse scrolling |text |
- ^ |with |
- ~ |many |
- ~ |lines |
- ~ |to |
- ~ |test |
- [No Name] [+] [No Name] [+] |
+ mouse scrolling {4:|}text |
+ ^ {4:|}with |
+ {0:~ }{4:|}many |
+ {0:~ }{4:|}lines |
+ {0:~ }{4:|}to |
+ {0:~ }{4:|}test |
+ {5:[No Name] [+] }{4:[No Name] [+] }|
Inserting |
text |
with |
many |
lines |
- [No Name] [+] |
+ {4:[No Name] [+] }|
|
]])
end)
@@ -488,7 +487,7 @@ describe('Mouse input', function()
|
|
bbbbbbbbbbbbbbb^b |
- ~ |
+ {0:~ }|
|
]])
@@ -497,7 +496,7 @@ describe('Mouse input', function()
|
|
n bbbbbbbbbbbbbbbbbbb^b |
- ~ |
+ {0:~ }|
|
]])
@@ -506,7 +505,7 @@ describe('Mouse input', function()
g |
|
^t and selection bbbbbbbbb|
- ~ |
+ {0:~ }|
|
]])
end)
@@ -514,12 +513,13 @@ describe('Mouse input', function()
describe('on concealed text', function()
-- Helpful for reading the test expectations:
-- :match Error /\^/
- local concealed = {
- c = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray }
- }
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 },
+ })
feed('ggdG')
execute('set concealcursor=n')
@@ -545,44 +545,44 @@ describe('Mouse input', function()
{c:^Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con|
{c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><1,0>')
screen:expect([[
{c:Y}^rem ip{c:X}um do{c: } {c:X}it {c: }, con|
{c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,0>')
screen:expect([[
{c:Y}rem ip{c:X}um do{c: } {c:^X}it {c: }, con|
{c:X}tet {c: }ta ka{c:X}d {c:X}ber{c:X}en, no|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
{c:Y}rem ip{c:X}um do{c: } {c:X}it {c: }, con|
{c:X}tet {c: }ta ka{c:X}d {c:X}^ber{c:X}en, no|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
end) -- level 1 - non wrapped
it('(level 1) click on wrapped lines', function()
@@ -597,7 +597,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><6,1>')
screen:expect([[
@@ -608,7 +608,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
@@ -619,7 +619,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,3>')
screen:expect([[
@@ -630,7 +630,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
end) -- level 1 - wrapped
@@ -642,44 +642,44 @@ describe('Mouse input', function()
{c:^Y}rem ip{c:X}um do {c:X}it , con{c:X}e|
{c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><1,0>')
screen:expect([[
{c:Y}^rem ip{c:X}um do {c:X}it , con{c:X}e|
{c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,0>')
screen:expect([[
{c:Y}rem ip{c:X}um do {c:X}^it , con{c:X}e|
{c:X}tet ta ka{c:X}d {c:X}ber{c:X}en, no |
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
{c:Y}rem ip{c:X}um do {c:X}it , con{c:X}e|
{c:X}tet ta ka{c:X}d {c:X}b^er{c:X}en, no |
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
end) -- level 2 - non wrapped
it('(level 2) click on wrapped lines', function()
@@ -694,7 +694,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><6,1>')
screen:expect([[
@@ -705,7 +705,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
@@ -716,7 +716,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,3>')
screen:expect([[
@@ -727,7 +727,7 @@ describe('Mouse input', function()
, no {c:X}ea takimata {c:X}anctu{c:X}|
e{c:X}t. |
|
- ]], concealed)
+ ]])
end) -- level 2 - wrapped
@@ -739,44 +739,44 @@ describe('Mouse input', function()
^rem ipum do it , conetetu|
tet ta kad beren, no ea t|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><1,0>')
screen:expect([[
r^em ipum do it , conetetu|
tet ta kad beren, no ea t|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,0>')
screen:expect([[
rem ipum do it ^, conetetu|
tet ta kad beren, no ea t|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
rem ipum do it , conetetu|
tet ta kad bere^n, no ea t|
|
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
- ]], concealed)
+ ]])
end) -- level 3 - non wrapped
it('(level 3) click on wrapped lines', function()
@@ -791,7 +791,7 @@ describe('Mouse input', function()
, no ea takimata anctu |
et. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><6,1>')
screen:expect([[
@@ -802,7 +802,7 @@ describe('Mouse input', function()
, no ea takimata anctu |
et. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,1>')
screen:expect([[
@@ -813,7 +813,7 @@ describe('Mouse input', function()
, no ea takimata anctu |
et. |
|
- ]], concealed)
+ ]])
feed('<esc><LeftMouse><15,3>')
screen:expect([[
@@ -824,7 +824,7 @@ describe('Mouse input', function()
, no ea takimata anctu |
et. |
|
- ]], concealed)
+ ]])
end) -- level 3 - wrapped
end)
end)
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
index c7c8986527..22ffc156ef 100644
--- a/test/functional/ui/output_spec.lua
+++ b/test/functional/ui/output_spec.lua
@@ -9,12 +9,12 @@ describe("shell command :!", function()
'", "-u", "NONE", "-i", "NONE", "--cmd", "set noswapfile"]')
screen:expect([[
{1: } |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ {5:[No Name] }|
|
- -- TERMINAL -- |
+ {3:-- TERMINAL --} |
]])
end)
@@ -27,13 +27,13 @@ describe("shell command :!", function()
-- to avoid triggering a UI flush.
child_session.feed_data(":!printf foo; sleep 200\n")
screen:expect([[
- ~ |
- ~ |
- [No Name] |
- :!printf foo; sleep 200 |
+ {1: } |
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ {5:[No Name] }|
|
- foo |
- -- TERMINAL -- |
+ {3:-- TERMINAL --} |
]])
end)
end)
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index d7af2a4fce..b219196866 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -234,8 +234,10 @@ function Screen:expect(expected, attr_ids, attr_ignore)
return (
'Row ' .. tostring(i) .. ' didn\'t match.\n'
.. 'Expected:\n|' .. table.concat(msg_expected_rows, '|\n|') .. '|\n'
- .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|'
- )
+ .. 'Actual:\n|' .. table.concat(actual_rows, '|\n|') .. '|\n\n' .. [[
+To print the expect() call that would assert the current screen state, use
+screen:snaphot_util(). In case of non-deterministic failures, use
+screen:redraw_debug() to show all intermediate screen states. ]])
end
end
end)
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 9249be4aec..d8cff1c766 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -15,7 +15,10 @@ describe('Initial screen', function()
set_session(screen_nvim)
screen = Screen.new()
screen:attach()
- screen:set_default_attr_ignore( {{bold=true, foreground=255}} )
+ screen:set_default_attr_ids( {
+ [0] = {bold=true, foreground=255},
+ [1] = {bold=true, reverse=true},
+ } )
end)
after_each(function()
@@ -25,18 +28,18 @@ describe('Initial screen', function()
it('is the default initial screen', function()
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
|
]])
end)
@@ -49,7 +52,16 @@ describe('Screen', function()
clear()
screen = Screen.new()
screen:attach()
- screen:set_default_attr_ignore( {{bold=true, foreground=255}} )
+ screen:set_default_attr_ids( {
+ [0] = {bold=true, foreground=255},
+ [1] = {bold=true, reverse=true},
+ [2] = {bold=true},
+ [3] = {reverse=true},
+ [4] = {background = Screen.colors.LightGrey, underline = true},
+ [5] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Fuchsia},
+ [6] = {bold = true, foreground = Screen.colors.Fuchsia},
+ [7] = {bold = true, foreground = Screen.colors.SeaGreen},
+ } )
end)
after_each(function()
@@ -147,18 +159,18 @@ describe('Screen', function()
execute('sp')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] }|
:sp |
]])
end)
@@ -168,18 +180,18 @@ describe('Screen', function()
execute('resize 8')
screen:expect([[
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
|
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] }|
:resize 8 |
]])
end)
@@ -187,36 +199,36 @@ describe('Screen', function()
it('horizontal and vertical', function()
execute('sp', 'vsp', 'vsp')
screen:expect([[
- ^ | | |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- [No Name] [No Name] [No Name] |
+ ^ {3:|} {3:|} |
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {1:[No Name] }{3:[No Name] [No Name] }|
|
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] }|
|
]])
insert('hello')
screen:expect([[
- hell^o |hello |hello |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- [No Name] [+] [No Name] [+] [No Name] [+] |
+ hell^o {3:|}hello {3:|}hello |
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] [+] }|
|
]])
end)
@@ -228,55 +240,55 @@ describe('Screen', function()
execute('sp', 'vsp', 'vsp')
insert('hello')
screen:expect([[
- hell^o |hello |hello |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- [No Name] [+] [No Name] [+] [No Name] [+] |
+ hell^o {3:|}hello {3:|}hello |
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- ~ |
- ~ |
- ~ |
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] [+] }|
|
]])
execute('tabnew')
insert('hello2')
feed('h')
screen:expect([[
- 4+ [No Name] + [No Name] X|
+ {4: }{5:4}{4:+ [No Name] }{2: + [No Name] }{3: }{4:X}|
hell^o2 |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
]])
execute('tabprevious')
screen:expect([[
- 4+ [No Name] + [No Name] X|
- hell^o |hello |hello |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- ~ |~ |~ |
- [No Name] [+] [No Name] [+] [No Name] [+] |
+ {2: }{6:4}{2:+ [No Name] }{4: + [No Name] }{3: }{4:X}|
+ hell^o {3:|}hello {3:|}hello |
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {0:~ }{3:|}{0:~ }{3:|}{0:~ }|
+ {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
hello |
- ~ |
- ~ |
- ~ |
- [No Name] [+] |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {3:[No Name] [+] }|
|
]])
end)
@@ -289,17 +301,17 @@ describe('Screen', function()
line 1 |
line 2 |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- -- INSERT -- |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
]])
end)
end)
@@ -314,17 +326,17 @@ describe('Screen', function()
screen:expect([[
0123^456 |
789 |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:set ruler 1,5 All |
]])
end)
@@ -335,18 +347,18 @@ describe('Screen', function()
feed(':ls')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:ls^ |
]])
end)
@@ -354,20 +366,20 @@ describe('Screen', function()
it('execute command with multi-line output', function()
feed(':ls<cr>')
screen:expect([[
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:ls |
1 %a "[No Name]" line 1 |
- Press ENTER or type command to continue^ |
+ {7:Press ENTER or type command to continue}^ |
]])
feed('<cr>') -- skip the "Press ENTER..." state or tests will hang
end)
@@ -392,19 +404,19 @@ describe('Screen', function()
]])
execute('sp', 'vsp', 'vsp')
screen:expect([[
- and |and |and |
- clearing |clearing |clearing |
- in |in |in |
- split |split |split |
- windows |windows |windows |
- ^ | | |
- [No Name] [+] [No Name] [+] [No Name] [+] |
+ and {3:|}and {3:|}and |
+ clearing {3:|}clearing {3:|}clearing |
+ in {3:|}in {3:|}in |
+ split {3:|}split {3:|}split |
+ windows {3:|}windows {3:|}windows |
+ ^ {3:|} {3:|} |
+ {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
end)
@@ -412,121 +424,121 @@ describe('Screen', function()
it('only affects the current scroll region', function()
feed('6k')
screen:expect([[
- ^scrolling |and |and |
- and |clearing |clearing |
- clearing |in |in |
- in |split |split |
- split |windows |windows |
- windows | | |
- [No Name] [+] [No Name] [+] [No Name] [+] |
+ ^scrolling {3:|}and {3:|}and |
+ and {3:|}clearing {3:|}clearing |
+ clearing {3:|}in {3:|}in |
+ in {3:|}split {3:|}split |
+ split {3:|}windows {3:|}windows |
+ windows {3:|} {3:|} |
+ {1:[No Name] [+] }{3:[No Name] [+] [No Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('<c-w>l')
screen:expect([[
- scrolling |and |and |
- and |clearing |clearing |
- clearing |in |in |
- in |split |split |
- split |windows |windows |
- windows |^ | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}and {3:|}and |
+ and {3:|}clearing {3:|}clearing |
+ clearing {3:|}in {3:|}in |
+ in {3:|}split {3:|}split |
+ split {3:|}windows {3:|}windows |
+ windows {3:|}^ {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('gg')
screen:expect([[
- scrolling |^Inserting |and |
- and |text |clearing |
- clearing |with |in |
- in |many |split |
- split |lines |windows |
- windows |to | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}^Inserting {3:|}and |
+ and {3:|}text {3:|}clearing |
+ clearing {3:|}with {3:|}in |
+ in {3:|}many {3:|}split |
+ split {3:|}lines {3:|}windows |
+ windows {3:|}to {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('7j')
screen:expect([[
- scrolling |with |and |
- and |many |clearing |
- clearing |lines |in |
- in |to |split |
- split |test |windows |
- windows |^scrolling | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}with {3:|}and |
+ and {3:|}many {3:|}clearing |
+ clearing {3:|}lines {3:|}in |
+ in {3:|}to {3:|}split |
+ split {3:|}test {3:|}windows |
+ windows {3:|}^scrolling {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('2j')
screen:expect([[
- scrolling |lines |and |
- and |to |clearing |
- clearing |test |in |
- in |scrolling |split |
- split |and |windows |
- windows |^clearing | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}lines {3:|}and |
+ and {3:|}to {3:|}clearing |
+ clearing {3:|}test {3:|}in |
+ in {3:|}scrolling {3:|}split |
+ split {3:|}and {3:|}windows |
+ windows {3:|}^clearing {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('5k')
screen:expect([[
- scrolling |^lines |and |
- and |to |clearing |
- clearing |test |in |
- in |scrolling |split |
- split |and |windows |
- windows |clearing | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}^lines {3:|}and |
+ and {3:|}to {3:|}clearing |
+ clearing {3:|}test {3:|}in |
+ in {3:|}scrolling {3:|}split |
+ split {3:|}and {3:|}windows |
+ windows {3:|}clearing {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
feed('k')
screen:expect([[
- scrolling |^many |and |
- and |lines |clearing |
- clearing |to |in |
- in |test |split |
- split |scrolling |windows |
- windows |and | |
- [No Name] [+] [No Name] [+] <Name] [+] |
+ scrolling {3:|}^many {3:|}and |
+ and {3:|}lines {3:|}clearing |
+ clearing {3:|}to {3:|}in |
+ in {3:|}test {3:|}split |
+ split {3:|}scrolling {3:|}windows |
+ windows {3:|}and {3:|} |
+ {3:[No Name] [+] }{1:[No Name] [+] }{3:<Name] [+] }|
clearing |
in |
split |
windows |
|
- [No Name] [+] |
+ {3:[No Name] [+] }|
|
]])
end)
@@ -541,10 +553,10 @@ describe('Screen', function()
it('rebuilds the whole screen', function()
screen:expect([[
resize^ |
- ~ |
- ~ |
- ~ |
- -- INSERT -- |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {2:-- INSERT --} |
]])
end)
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index 894a75d355..cd4cc68c80 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -6,23 +6,17 @@ local execute = helpers.execute
describe('search highlighting', function()
local screen
local colors = Screen.colors
- local hl_colors = {
- NonText = colors.Blue,
- Search = colors.Yellow,
- Message = colors.Red,
- }
before_each(function()
clear()
screen = Screen.new(40, 7)
screen:attach()
- --ignore highligting of ~-lines
screen:set_default_attr_ids( {
- [1] = {background = hl_colors.Search},
- [2] = {reverse = true},
- [3] = {foreground = hl_colors.Message},
+ [1] = {bold=true, foreground=Screen.colors.Blue},
+ [2] = {background = colors.Yellow}, -- Search
+ [3] = {reverse = true},
+ [4] = {foreground = colors.Red}, -- Message
})
- screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} )
end)
it('is disabled by ":set nohlsearch"', function()
@@ -32,10 +26,10 @@ describe('search highlighting', function()
screen:expect([[
some ^text |
more text |
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/text |
]])
end)
@@ -51,35 +45,35 @@ describe('search highlighting', function()
-- 'hlsearch' is enabled by default. #2859
feed("gg/text<cr>")
screen:expect([[
- some {1:^text} |
- more {1:text}stuff |
- stupid{1:texttext}stuff |
- a {1:text} word |
+ some {2:^text} |
+ more {2:text}stuff |
+ stupid{2:texttext}stuff |
+ a {2:text} word |
|
- ~ |
+ {1:~ }|
/text |
]])
-- overlapping matches not allowed
feed("3nx")
screen:expect([[
- some {1:text} |
- more {1:text}stuff |
- stupid{1:text}^extstuff |
- a {1:text} word |
+ some {2:text} |
+ more {2:text}stuff |
+ stupid{2:text}^extstuff |
+ a {2:text} word |
|
- ~ |
+ {1:~ }|
/text |
]])
feed("ggn*") -- search for entire word
screen:expect([[
- some {1:text} |
+ some {2:text} |
more textstuff |
stupidtextextstuff |
- a {1:^text} word |
+ a {2:^text} word |
|
- ~ |
+ {1:~ }|
/\<text\> |
]])
@@ -90,7 +84,7 @@ describe('search highlighting', function()
stupidtextextstuff |
a ^text word |
|
- ~ |
+ {1:~ }|
:nohlsearch |
]])
end)
@@ -104,45 +98,45 @@ describe('search highlighting', function()
]])
feed("gg/li")
screen:expect([[
- the first {2:li}ne |
+ the first {3:li}ne |
in a little file |
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/li^ |
]])
feed("t")
screen:expect([[
the first line |
- in a {2:lit}tle file |
+ in a {3:lit}tle file |
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/lit^ |
]])
feed("<cr>")
screen:expect([[
the first line |
- in a {1:^lit}tle file |
+ in a {2:^lit}tle file |
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/lit |
]])
feed("/fir")
screen:expect([[
- the {2:fir}st line |
- in a {1:lit}tle file |
+ the {3:fir}st line |
+ in a {2:lit}tle file |
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/fir^ |
]])
@@ -150,11 +144,11 @@ describe('search highlighting', function()
feed("<esc>/ttle")
screen:expect([[
the first line |
- in a {1:li}{2:ttle} file |
+ in a {2:li}{3:ttle} file |
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/ttle^ |
]])
end)
@@ -168,12 +162,12 @@ describe('search highlighting', function()
feed("gg/mat/e")
screen:expect([[
- not the {2:mat}ch you're looking for |
+ not the {3:mat}ch you're looking for |
the match is here |
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/mat/e^ |
]])
@@ -181,22 +175,22 @@ describe('search highlighting', function()
feed("<esc>2/mat/e")
screen:expect([[
not the match you're looking for |
- the {2:mat}ch is here |
- ~ |
- ~ |
- ~ |
- ~ |
+ the {3:mat}ch is here |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/mat/e^ |
]])
feed("<cr>")
screen:expect([[
- not the {1:mat}ch you're looking for |
- the {1:ma^t}ch is here |
- ~ |
- ~ |
- ~ |
- ~ |
+ not the {2:mat}ch you're looking for |
+ the {2:ma^t}ch is here |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
/mat/e |
]])
end)
@@ -207,28 +201,37 @@ describe('search highlighting', function()
feed('/line\\na<cr>')
screen:expect([[
|
- a repeated {1:^line} |
- {1:a} repeated {1:line} |
- {1:a} repeated {1:line} |
- {1:a} repeated line |
- ~ |
- {3:search hit BOTTOM, continuing at TOP} |
+ a repeated {2:^line} |
+ {2:a} repeated {2:line} |
+ {2:a} repeated {2:line} |
+ {2:a} repeated line |
+ {1:~ }|
+ {4:search hit BOTTOM, continuing at TOP} |
]])
-- it redraws rows above the changed one
feed('4Grb')
screen:expect([[
|
- a repeated {1:line} |
- {1:a} repeated line |
- ^b repeated {1:line} |
- {1:a} repeated line |
- ~ |
- {3:search hit BOTTOM, continuing at TOP} |
+ a repeated {2:line} |
+ {2:a} repeated line |
+ ^b repeated {2:line} |
+ {2:a} repeated line |
+ {1:~ }|
+ {4:search hit BOTTOM, continuing at TOP} |
]])
end)
it('works with matchadd and syntax', function()
+ screen:set_default_attr_ids( {
+ [1] = {bold=true, foreground=Screen.colors.Blue},
+ [2] = {background = colors.Yellow},
+ [3] = {reverse = true},
+ [4] = {foreground = colors.Red},
+ [5] = {bold = true, background = colors.Green},
+ [6] = {italic = true, background = colors.Magenta},
+ [7] = {bold = true, background = colors.Yellow},
+ } )
execute('set hlsearch')
insert([[
very special text
@@ -243,25 +246,23 @@ describe('search highlighting', function()
-- is used (and matches with lower priorities are not combined)
execute("/ial te")
screen:expect([[
- very {4:spec^ial}{1: te}{5:xt} |
+ very {5:spec^ial}{2: te}{6:xt} |
|
- ~ |
- ~ |
- ~ |
- ~ |
- {3:search hit BOTTOM, continuing at TOP} |
- ]], {[1] = {background = hl_colors.Search}, [2] = {reverse = true},
- [3] = {foreground = hl_colors.Message}, [4] = {bold = true, background =
- colors.Green}, [5] = {italic = true, background = colors.Magenta}})
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {4:search hit BOTTOM, continuing at TOP} |
+ ]])
execute("call clearmatches()")
screen:expect([[
- very spec{1:^ial te}xt |
+ very spec{2:^ial te}xt |
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:call clearmatches() |
]])
@@ -269,16 +270,14 @@ describe('search highlighting', function()
-- nonconflicting attributes are combined
execute("syntax keyword MyGroup special")
screen:expect([[
- very {4:spec}{5:^ial}{1: te}xt |
+ very {5:spec}{7:^ial}{2: te}xt |
|
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:syntax keyword MyGroup special |
- ]], {[1] = {background = hl_colors.Search}, [2] = {reverse = true},
- [3] = {foreground = hl_colors.Message}, [4] = {bold = true,
- background = colors.Green}, [5] = {bold = true, background = hl_colors.Search}})
+ ]])
end)
end)
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index 2b6e294627..eabd05b349 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -9,7 +9,11 @@ describe('Signs', function()
clear()
screen = Screen.new()
screen:attach()
- screen:set_default_attr_ignore( {{}, {bold=true, foreground=255}} )
+ screen:set_default_attr_ids( {
+ [0] = {bold=true, foreground=255},
+ [1] = {background = Screen.colors.Yellow},
+ [2] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey},
+ } )
end)
after_each(function()
@@ -25,19 +29,19 @@ describe('Signs', function()
execute('sign place 2 line=3 name=piet buffer=1')
execute('sign place 3 line=1 name=pietx buffer=1')
screen:expect([[
- >!a |
- b |
- >>c |
- ^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {1:>!}a |
+ {2: }b |
+ {1:>>}c |
+ {2: }^ |
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
+ {2: }{0:~ }|
:sign place 3 line=1 name=pietx buffer=1 |
]])
end)
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua
index c2ab0711c0..4e2bd4d6be 100644
--- a/test/functional/ui/syntax_conceal_spec.lua
+++ b/test/functional/ui/syntax_conceal_spec.lua
@@ -10,8 +10,10 @@ describe('Screen', function()
clear()
screen = Screen.new(nil,10)
screen:attach()
- screen:set_default_attr_ignore( {{bold=true, foreground=255}} )
- screen:set_default_attr_ids( {{foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}} )
+ screen:set_default_attr_ids( {
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray}
+ } )
end)
after_each(function()
@@ -46,8 +48,8 @@ describe('Screen', function()
{1:∧} |
{1:∧} |
^ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
]])
end)
@@ -62,8 +64,8 @@ describe('Screen', function()
{1:∧} |
^&& |
|
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
]])
end)
@@ -78,8 +80,8 @@ describe('Screen', function()
{1:∧} |
{1:∧} |
|
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
]])
end)
@@ -94,8 +96,8 @@ describe('Screen', function()
{1:∧} |
{1:∧} |
|
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
]])
end)
@@ -110,8 +112,8 @@ describe('Screen', function()
{1:∧} |
{1:∧} |
^ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
:syn match dAmpersand '[&][&]' conceal cchar=∧ |
]])
end)
@@ -125,12 +127,12 @@ describe('Screen', function()
{1:λ} |
{1:λ} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:syn keyword kLambda lambda conceal cchar=λ |
]])
end) -- Keyword
@@ -149,12 +151,12 @@ describe('Screen', function()
{1:R} |
{1:R} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
]])
end)
@@ -167,12 +169,12 @@ describe('Screen', function()
{1: } a region of text {1:-} |
{1: } a region of text {1:-} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
]])
end)
@@ -186,10 +188,10 @@ describe('Screen', function()
{1: } A region with {1: } a nested {1: } nested region.{1:-} |
{1:-} {1:-} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
|
]])
end)
@@ -208,12 +210,12 @@ describe('Screen', function()
{1:-} |
{1:-} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:syn region rText start='<r>' end='</r>' cchar=- |
]])
end)
@@ -229,10 +231,10 @@ describe('Screen', function()
<i> italian text </i> |
<i> italian text </i> |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:syn region iText start='<i>' end='</i>' cchar=* |
]])
execute("syntax conceal on")
@@ -243,10 +245,10 @@ describe('Screen', function()
{1:*} |
{1:*} |
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:syn region iText start='<i>' end='</i>' cchar=* |
]])
end)
@@ -271,10 +273,10 @@ describe('Screen', function()
+ With cchar |
|
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:let &conceallevel=0 |
]])
end)
@@ -287,10 +289,10 @@ describe('Screen', function()
{1:C} |
|
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:let &conceallevel=1 |
]])
end)
@@ -303,10 +305,10 @@ describe('Screen', function()
{1:C} |
|
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:let &conceallevel=2 |
]])
end)
@@ -319,10 +321,10 @@ describe('Screen', function()
|
|
^ |
- ~ |
- ~ |
- ~ |
- ~ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
:let &conceallevel=3 |
]])
end)
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 2a55d27567..1d582703d0 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -39,7 +39,7 @@ describe('command line completion', function()
clear()
screen = Screen.new(40, 5)
screen:attach()
- screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
+ screen:set_default_attr_ids({[1]={bold=true, foreground=Screen.colors.Blue}})
end)
after_each(function()
@@ -55,9 +55,9 @@ describe('command line completion', function()
feed(':!<tab><bs>')
screen:expect([[
|
- ~ |
- ~ |
- ~ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
:!Xtest-functional-viml-compl-dir^ |
]])
end)