mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
tests: remove deprecated hl_colors
This commit is contained in:
@@ -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_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
|
||||
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},
|
||||
[1] = {foreground = Screen.colors.Fuchsia}, -- String
|
||||
[2] = {foreground = Screen.colors.Brown, bold = true}, -- Statement
|
||||
[3] = {foreground = Screen.colors.SlateBlue}, -- Special
|
||||
[4] = {bold = true, foreground = Screen.colors.SlateBlue},
|
||||
[5] = {foreground = Screen.colors.DarkCyan}, -- Identifier
|
||||
[6] = {bold = true},
|
||||
[7] = {underline = true, bold = true, foreground = hl_colors.Special},
|
||||
[8] = {foreground = hl_colors.Special, underline = true}
|
||||
[7] = {underline = true, bold = true, foreground = Screen.colors.SlateBlue},
|
||||
[8] = {foreground = Screen.colors.SlateBlue, underline = true}
|
||||
})
|
||||
curbuf = request('vim_get_current_buffer')
|
||||
end)
|
||||
|
||||
@@ -89,17 +89,12 @@ 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}} )
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
@@ -238,7 +233,7 @@ 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()
|
||||
@@ -258,7 +253,7 @@ describe('Default highlight groups', function()
|
||||
:ls |
|
||||
1 %a "[No Name]" line 1 |
|
||||
{1:Press ENTER or type command to continue}^ |
|
||||
]], {[1] = {bold = true, foreground = hlgroup_colors.Question}})
|
||||
]], {[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()
|
||||
@@ -405,13 +400,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,8 +411,8 @@ 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({[1] = {background=Screen.colors.Grey90}})
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
|
||||
execute('highlight clear ModeMsg')
|
||||
execute('set cursorline')
|
||||
feed('i')
|
||||
@@ -497,22 +485,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 +569,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,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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,15 +17,15 @@ describe('Mouse input', function()
|
||||
screen = Screen.new(25, 5)
|
||||
screen:attach()
|
||||
screen:set_default_attr_ids({
|
||||
[1] = {background = hlgroup_colors.Visual},
|
||||
[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,
|
||||
},
|
||||
})
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText}} )
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
|
||||
feed('itesting<cr>mouse<cr>support and selection<esc>')
|
||||
screen:expect([[
|
||||
testing |
|
||||
@@ -409,7 +404,7 @@ describe('Mouse input', function()
|
||||
]])
|
||||
screen:try_resize(53, 14)
|
||||
execute('sp', 'vsp')
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=hlgroup_colors.NonText},
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue},
|
||||
{reverse=true}, {bold=true, reverse=true}} )
|
||||
screen:expect([[
|
||||
lines |lines |
|
||||
|
||||
@@ -6,23 +6,18 @@ 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_ignore( {{bold=true, foreground=colors.Blue}} )
|
||||
screen:set_default_attr_ids( {
|
||||
[1] = {background = hl_colors.Search},
|
||||
[1] = {background = colors.Yellow}, -- Search
|
||||
[2] = {reverse = true},
|
||||
[3] = {foreground = hl_colors.Message},
|
||||
[3] = {foreground = colors.Red}, -- Message
|
||||
})
|
||||
screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} )
|
||||
end)
|
||||
|
||||
it('is disabled by ":set nohlsearch"', function()
|
||||
@@ -250,8 +245,8 @@ describe('search highlighting', function()
|
||||
~ |
|
||||
~ |
|
||||
{3:search hit BOTTOM, continuing at TOP} |
|
||||
]], {[1] = {background = hl_colors.Search}, [2] = {reverse = true},
|
||||
[3] = {foreground = hl_colors.Message}, [4] = {bold = true, background =
|
||||
]], {[1] = {background = colors.Yellow}, [2] = {reverse = true},
|
||||
[3] = {foreground = colors.Red}, [4] = {bold = true, background =
|
||||
colors.Green}, [5] = {italic = true, background = colors.Magenta}})
|
||||
|
||||
execute("call clearmatches()")
|
||||
@@ -276,9 +271,9 @@ describe('search highlighting', function()
|
||||
~ |
|
||||
~ |
|
||||
: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}})
|
||||
]], {[1] = {background = colors.Yellow}, [2] = {reverse = true},
|
||||
[3] = {foreground = colors.Red}, [4] = {bold = true,
|
||||
background = colors.Green}, [5] = {bold = true, background = colors.Yellow}})
|
||||
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user