vim-patch:9.1.0106: Visual highlight hard to read with 'termguicolors'

Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

34e4a05d02

Co-authored-by: Maxim Kim <habamax@gmail.com>
This commit is contained in:
zeertzjq
2024-02-15 07:49:39 +08:00
parent 440ce0d246
commit 31b3c62845
22 changed files with 73 additions and 91 deletions

View File

@@ -231,7 +231,7 @@ if vim.o.background == 'light' then
hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' }) hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'LightMagenta' })
hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } }) hi('TabLine', { bg = 'LightGrey', underline = true, ctermfg = 'Black', ctermbg = 'LightGrey', cterm = { underline = true } })
hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' }) hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'DarkMagenta' })
hi('Visual', { bg = 'LightGrey', ctermfg = 'Black', ctermbg = 'Grey' }) hi('Visual', { fg = 'Black', bg = 'LightGrey', ctermfg = 'Black', ctermbg = 'Grey' })
hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' }) hi('WarningMsg', { fg = 'Red', ctermfg = 'DarkRed' })
hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' }) hi('Comment', { fg = 'Blue', ctermfg = 'DarkBlue' })
hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' }) hi('Constant', { fg = 'Magenta', ctermfg = 'DarkRed' })
@@ -270,7 +270,7 @@ else
hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' }) hi('SpellRare', { sp = 'Magenta', undercurl = true, ctermbg = 'Magenta' })
hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } }) hi('TabLine', { bg = 'DarkGrey', underline = true, ctermfg = 'White', ctermbg = 'DarkGrey', cterm = { underline = true } })
hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' }) hi('Title', { fg = 'Magenta', bold = true, ctermfg = 'LightMagenta' })
hi('Visual', { bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' }) hi('Visual', { fg = 'LightGrey', bg = '#575757', ctermfg = 'Black', ctermbg = 'Grey' })
hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' }) hi('WarningMsg', { fg = 'Red', ctermfg = 'LightRed' })
hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' }) hi('Comment', { fg = '#80a0ff', ctermfg = 'Cyan' })
hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' }) hi('Constant', { fg = '#ffa0a0', ctermfg = 'Magenta' })

View File

@@ -28,7 +28,7 @@ describe('mappings with <Cmd>', function()
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, [2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[3] = { bold = true, foreground = Screen.colors.SeaGreen4 }, [3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[4] = { bold = true }, [4] = { bold = true },
[5] = { background = Screen.colors.LightGrey }, [5] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[6] = { foreground = Screen.colors.Blue1 }, [6] = { foreground = Screen.colors.Blue1 },
[7] = { bold = true, reverse = true }, [7] = { bold = true, reverse = true },
[8] = { background = Screen.colors.WebGray }, [8] = { background = Screen.colors.WebGray },

View File

@@ -69,7 +69,7 @@ describe('breakindent', function()
]]) ]])
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { bold = true, reverse = true }, -- StatusLine [2] = { bold = true, reverse = true }, -- StatusLine
[3] = { reverse = true }, -- StatusLineNC [3] = { reverse = true }, -- StatusLineNC
[4] = { bold = true }, -- ModeMsg [4] = { bold = true }, -- ModeMsg

View File

@@ -33,7 +33,7 @@ describe('display', function()
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = { bold = true }, -- ModeMsg [1] = { bold = true }, -- ModeMsg
[2] = { background = Screen.colors.LightGrey }, -- Visual [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[3] = { background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue }, -- SignColumn [3] = { background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue }, -- SignColumn
}) })

View File

@@ -101,7 +101,7 @@ describe('Visual selection highlight', function()
local screen = Screen.new(60, 6) local screen = Screen.new(60, 6)
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { bold = true }, -- ModeMsg [2] = { bold = true }, -- ModeMsg
}) })
screen:attach() screen:attach()

View File

@@ -206,7 +206,7 @@ describe('listlbr', function()
local screen = Screen.new(60, 6) local screen = Screen.new(60, 6)
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg [2] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
}) })
screen:attach() screen:attach()

View File

@@ -216,7 +216,7 @@ describe('linebreak', function()
local screen = Screen.new(60, 8) local screen = Screen.new(60, 8)
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { bold = true }, -- ModeMsg [2] = { bold = true }, -- ModeMsg
}) })
screen:attach() screen:attach()

View File

@@ -14,7 +14,7 @@ describe('matchparen', function()
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = { bold = true }, [1] = { bold = true },
[2] = { background = Screen.colors.LightGrey }, [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
}) })
exec([[ exec([[

View File

@@ -772,9 +772,9 @@ describe('Search highlight', function()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [1] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[2] = { bold = true }, -- ModeMsg, Search [2] = { bold = true }, -- ModeMsg, Search
[3] = { background = Screen.colors.LightGrey }, -- Visual [3] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[4] = { background = Screen.colors.Yellow, bold = true }, -- Search [4] = { background = Screen.colors.Yellow, bold = true }, -- Search
[5] = { background = Screen.colors.LightGrey, bold = true }, -- Visual + Search [5] = { background = Screen.colors.LightGrey, bold = true, foreground = Screen.colors.Black },
}) })
screen:attach() screen:attach()
exec([[ exec([[

View File

@@ -70,7 +70,7 @@ describe('statusline', function()
it('showcmdloc=statusline works', function() it('showcmdloc=statusline works', function()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { bold = true }, -- MoreMsg [2] = { bold = true }, -- MoreMsg
[3] = { bold = true, reverse = true }, -- StatusLine [3] = { bold = true, reverse = true }, -- StatusLine
[5] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, -- Folded [5] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, -- Folded

View File

@@ -18,7 +18,7 @@ describe('tabline', function()
it('showcmdloc=tabline works', function() it('showcmdloc=tabline works', function()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText [0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
[1] = { background = Screen.colors.LightGrey }, -- Visual [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
[2] = { bold = true }, -- MoreMsg, TabLineSel [2] = { bold = true }, -- MoreMsg, TabLineSel
[3] = { reverse = true }, -- TabLineFill [3] = { reverse = true }, -- TabLineFill
[4] = { background = Screen.colors.LightGrey, underline = true }, -- TabLine [4] = { background = Screen.colors.LightGrey, underline = true }, -- TabLine

View File

@@ -15,7 +15,7 @@ describe('Visual highlight', function()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { foreground = Screen.colors.Blue, bold = true }, -- NonText [0] = { foreground = Screen.colors.Blue, bold = true }, -- NonText
[1] = { bold = true }, -- ModeMsg [1] = { bold = true }, -- ModeMsg
[2] = { background = Screen.colors.LightGrey }, -- Visual [2] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, -- Visual
}) })
screen:attach() screen:attach()
end) end)

View File

@@ -29,7 +29,7 @@ describe('Buffer highlighting', function()
[10] = { foreground = Screen.colors.Red }, [10] = { foreground = Screen.colors.Red },
[11] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red }, [11] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[12] = { foreground = Screen.colors.Blue1 }, [12] = { foreground = Screen.colors.Blue1 },
[13] = { background = Screen.colors.LightGrey }, [13] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[14] = { background = Screen.colors.Gray90 }, [14] = { background = Screen.colors.Gray90 },
[15] = { background = Screen.colors.Gray90, bold = true, foreground = Screen.colors.Brown }, [15] = { background = Screen.colors.Gray90, bold = true, foreground = Screen.colors.Brown },
[16] = { foreground = Screen.colors.Magenta, background = Screen.colors.Gray90 }, [16] = { foreground = Screen.colors.Magenta, background = Screen.colors.Gray90 },

View File

@@ -22,7 +22,7 @@ local function new_screen(opt)
[5] = { bold = true, foreground = Screen.colors.SeaGreen4 }, [5] = { bold = true, foreground = Screen.colors.SeaGreen4 },
[6] = { foreground = Screen.colors.Magenta }, [6] = { foreground = Screen.colors.Magenta },
[7] = { bold = true, foreground = Screen.colors.Brown }, [7] = { bold = true, foreground = Screen.colors.Brown },
[8] = { background = Screen.colors.LightGrey }, [8] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[9] = { bold = true }, [9] = { bold = true },
[10] = { background = Screen.colors.Yellow1 }, [10] = { background = Screen.colors.Yellow1 },
}) })

View File

@@ -806,14 +806,14 @@ describe('extmark decorations', function()
[23] = {foreground = Screen.colors.Magenta1, background = Screen.colors.LightGrey}; [23] = {foreground = Screen.colors.Magenta1, background = Screen.colors.LightGrey};
[24] = {bold = true}; [24] = {bold = true};
[25] = {background = Screen.colors.LightRed}; [25] = {background = Screen.colors.LightRed};
[26] = {background=Screen.colors.DarkGrey, foreground=Screen.colors.LightGrey}; [26] = {background = Screen.colors.DarkGrey, foreground = Screen.colors.LightGrey};
[27] = {background = Screen.colors.Plum1}; [27] = {background = Screen.colors.LightGrey, foreground = Screen.colors.Black};
[28] = {underline = true, foreground = Screen.colors.SlateBlue}; [28] = {underline = true, foreground = Screen.colors.SlateBlue};
[29] = {foreground = Screen.colors.SlateBlue, background = Screen.colors.LightGray, underline = true}; [29] = {foreground = Screen.colors.SlateBlue, background = Screen.colors.LightGrey, underline = true};
[30] = {foreground = Screen.colors.DarkCyan, background = Screen.colors.LightGray, underline = true}; [30] = {foreground = Screen.colors.DarkCyan, background = Screen.colors.LightGrey, underline = true};
[31] = {underline = true, foreground = Screen.colors.DarkCyan}; [31] = {underline = true, foreground = Screen.colors.DarkCyan};
[32] = {underline = true}; [32] = {underline = true};
[33] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray}; [33] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey};
[34] = {background = Screen.colors.Yellow}; [34] = {background = Screen.colors.Yellow};
[35] = {background = Screen.colors.Yellow, bold = true, foreground = Screen.colors.Blue}; [35] = {background = Screen.colors.Yellow, bold = true, foreground = Screen.colors.Blue};
[36] = {foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Red}; [36] = {foreground = Screen.colors.Blue1, bold = true, background = Screen.colors.Red};
@@ -824,6 +824,7 @@ describe('extmark decorations', function()
[41] = {bold = true, reverse = true}; [41] = {bold = true, reverse = true};
[42] = {undercurl = true, special = Screen.colors.Red}; [42] = {undercurl = true, special = Screen.colors.Red};
[43] = {background = Screen.colors.Yellow, undercurl = true, special = Screen.colors.Red}; [43] = {background = Screen.colors.Yellow, undercurl = true, special = Screen.colors.Red};
[44] = {background = Screen.colors.LightMagenta};
} }
ns = api.nvim_create_namespace 'test' ns = api.nvim_create_namespace 'test'
@@ -1017,7 +1018,7 @@ describe('extmark decorations', function()
screen:expect{grid=[[ screen:expect{grid=[[
ababababababababababababababababababababab{4:01234567}| ababababababababababababababababababababab{4:01234567}|
{1:++}{4:89}abababababababababababababababababababa{4:0123456}| {1:++}{4:89}abababababababababababababababababababa{4:0123456}|
{1:++}^a{18:babab}ababababababababababababababababababababab| {1:++}^a{27:babab}ababababababababababababababababababababab|
{1:++}abababababababababababababababababababababababab| {1:++}abababababababababababababababababababababababab|
{1:++}ababab | {1:++}ababab |
{24:-- VISUAL --} | {24:-- VISUAL --} |
@@ -1027,7 +1028,7 @@ describe('extmark decorations', function()
screen:expect{grid=[[ screen:expect{grid=[[
ababababababababababababababababababababab{4:01234567}| ababababababababababababababababababababab{4:01234567}|
{1:++}{4:89}abababababababababababababababababababa{4:0123456}| {1:++}{4:89}abababababababababababababababababababa{4:0123456}|
{1:++}{18:ababa}^bababababababababababababababababababababab| {1:++}{27:ababa}^bababababababababababababababababababababab|
{1:++}abababababababababababababababababababababababab| {1:++}abababababababababababababababababababababababab|
{1:++}ababab | {1:++}ababab |
{24:-- VISUAL --} | {24:-- VISUAL --} |
@@ -1036,8 +1037,8 @@ describe('extmark decorations', function()
feed('gk') feed('gk')
screen:expect{grid=[[ screen:expect{grid=[[
ababababababababababababababababababababab{4:01234567}| ababababababababababababababababababababab{4:01234567}|
{1:++}{4:89}aba^b{18:ababababababababababababababababababababab}| {1:++}{4:89}aba^b{27:ababababababababababababababababababababab}|
{1:++}{18:a}{4:89}babababababababababababababababababababababab| {1:++}{27:a}{4:89}babababababababababababababababababababababab|
{1:++}abababababababababababababababababababababababab| {1:++}abababababababababababababababababababababababab|
{1:++}ababab | {1:++}ababab |
{24:-- VISUAL --} | {24:-- VISUAL --} |
@@ -1046,7 +1047,7 @@ describe('extmark decorations', function()
feed('o') feed('o')
screen:expect{grid=[[ screen:expect{grid=[[
ababababababababababababababababababababab{4:01234567}| ababababababababababababababababababababab{4:01234567}|
{1:++}{4:89}aba{18:bababababababababababababababababababababab}| {1:++}{4:89}aba{27:bababababababababababababababababababababab}|
{1:++}^a{4:89}babababababababababababababababababababababab| {1:++}^a{4:89}babababababababababababababababababababababab|
{1:++}abababababababababababababababababababababababab| {1:++}abababababababababababababababababababababababab|
{1:++}ababab | {1:++}ababab |
@@ -1185,6 +1186,7 @@ describe('extmark decorations', function()
]]} ]]}
command 'hi Blendy guibg=Red blend=30' command 'hi Blendy guibg=Red blend=30'
command 'hi! Visual guifg=NONE guibg=LightGrey'
api.nvim_buf_set_extmark(0, ns, 1, 5, { virt_text={{'blendy text - here', 'Blendy'}}, virt_text_pos='overlay', hl_mode='blend'}) api.nvim_buf_set_extmark(0, ns, 1, 5, { virt_text={{'blendy text - here', 'Blendy'}}, virt_text_pos='overlay', hl_mode='blend'})
api.nvim_buf_set_extmark(0, ns, 2, 5, { virt_text={{'combining color', 'Blendy'}}, virt_text_pos='overlay', hl_mode='combine'}) api.nvim_buf_set_extmark(0, ns, 2, 5, { virt_text={{'combining color', 'Blendy'}}, virt_text_pos='overlay', hl_mode='combine'})
api.nvim_buf_set_extmark(0, ns, 3, 5, { virt_text={{'replacing color', 'Blendy'}}, virt_text_pos='overlay', hl_mode='replace'}) api.nvim_buf_set_extmark(0, ns, 3, 5, { virt_text={{'replacing color', 'Blendy'}}, virt_text_pos='overlay', hl_mode='replace'})
@@ -1800,7 +1802,7 @@ describe('extmark decorations', function()
end end
screen:expect{grid=[[ screen:expect{grid=[[
{27: } | {44: } |
XXX |*2 XXX |*2
^XXX HELLO | ^XXX HELLO |
XXX |*7 XXX |*7
@@ -1901,7 +1903,8 @@ describe('extmark decorations', function()
feed('gg') feed('gg')
command('set ft=lua') command('set ft=lua')
command('syntax on') command('syntax on')
api.nvim_buf_set_extmark(0, ns, 0, 0, { end_col = 3, hl_mode = 'combine', hl_group = 'Visual' }) command('hi default MyMark guibg=LightGrey')
api.nvim_buf_set_extmark(0, ns, 0, 0, { end_col = 3, hl_mode = 'combine', hl_group = 'MyMark' })
command('hi default MyLine gui=underline') command('hi default MyLine gui=underline')
command('sign define CurrentLine linehl=MyLine') command('sign define CurrentLine linehl=MyLine')
fn.sign_place(6, 'Test', 'CurrentLine', '', { lnum = 1 }) fn.sign_place(6, 'Test', 'CurrentLine', '', { lnum = 1 })
@@ -1964,18 +1967,19 @@ describe('extmark decorations', function()
it('highlight applies to a full TAB on line with matches #20885', function() it('highlight applies to a full TAB on line with matches #20885', function()
screen:try_resize(50, 3) screen:try_resize(50, 3)
api.nvim_buf_set_lines(0, 0, -1, true, {'\t-- match1', ' -- match2'}) api.nvim_buf_set_lines(0, 0, -1, true, {'\t-- match1', ' -- match2'})
fn.matchadd('Underlined', 'match') fn.matchadd('NonText', 'match')
api.nvim_buf_set_extmark(0, ns, 0, 0, { end_row = 1, end_col = 0, hl_group = 'Visual' }) api.nvim_buf_set_extmark(0, ns, 0, 0, { end_row = 1, end_col = 0, hl_group = 'Search' })
api.nvim_buf_set_extmark(0, ns, 1, 0, { end_row = 2, end_col = 0, hl_group = 'Visual' }) api.nvim_buf_set_extmark(0, ns, 1, 0, { end_row = 2, end_col = 0, hl_group = 'Search' })
screen:expect{grid=[[ screen:expect{grid=[[
{18: ^ -- }{29:match}{18:1} | {34: ^ -- }{35:match}{34:1} |
{18: -- }{29:match}{18:2} | {34: -- }{35:match}{34:2} |
| |
]]} ]]}
end) end)
pending('highlight applies to a full TAB in visual block mode', function() pending('highlight applies to a full TAB in visual block mode', function()
screen:try_resize(50, 8) screen:try_resize(50, 8)
command('hi! Visual guifg=NONE guibg=LightGrey')
api.nvim_buf_set_lines(0, 0, -1, true, {'asdf', '\tasdf', '\tasdf', '\tasdf', 'asdf'}) api.nvim_buf_set_lines(0, 0, -1, true, {'asdf', '\tasdf', '\tasdf', '\tasdf', 'asdf'})
api.nvim_buf_set_extmark(0, ns, 0, 0, {end_row = 5, end_col = 0, hl_group = 'Underlined'}) api.nvim_buf_set_extmark(0, ns, 0, 0, {end_row = 5, end_col = 0, hl_group = 'Underlined'})
screen:expect([[ screen:expect([[
@@ -2339,11 +2343,10 @@ describe('extmark decorations', function()
local url = 'https://example.com' local url = 'https://example.com'
local attrs = screen:get_default_attr_ids() screen:set_default_attr_ids({
table.insert(attrs, { e = { bold = true, foreground = Screen.colors.Blue },
url = url, u = { url = url },
}) })
screen:set_default_attr_ids(attrs)
api.nvim_buf_set_extmark(0, ns, 1, 4, { api.nvim_buf_set_extmark(0, ns, 1, 4, {
end_col = 14, end_col = 14,
@@ -2352,7 +2355,7 @@ describe('extmark decorations', function()
screen:expect{grid=[[ screen:expect{grid=[[
for _,item in ipairs(items) do | for _,item in ipairs(items) do |
{44:local text}, hl_id_cell, count = unpack(item) | {u:local text}, hl_id_cell, count = unpack(item) |
if hl_id_cell ~= nil then | if hl_id_cell ~= nil then |
hl_id = hl_id_cell | hl_id = hl_id_cell |
end | end |
@@ -2363,8 +2366,8 @@ describe('extmark decorations', function()
colpos = colpos+1 | colpos = colpos+1 |
end | end |
en^d | en^d |
{1:~ }| {e:~ }|
{1:~ }| {e:~ }|
| |
]]} ]]}
end) end)
@@ -2383,7 +2386,7 @@ describe('decorations: inline virtual text', function()
[4] = {background = Screen.colors.Red1, foreground = Screen.colors.Gray100}; [4] = {background = Screen.colors.Red1, foreground = Screen.colors.Gray100};
[5] = {background = Screen.colors.Red1, bold = true}; [5] = {background = Screen.colors.Red1, bold = true};
[6] = {foreground = Screen.colors.DarkCyan}; [6] = {foreground = Screen.colors.DarkCyan};
[7] = {background = Screen.colors.LightGrey}; [7] = {background = Screen.colors.LightGrey, foreground = Screen.colors.Black};
[8] = {bold = true}; [8] = {bold = true};
[9] = {background = Screen.colors.Plum1}; [9] = {background = Screen.colors.Plum1};
[10] = {foreground = Screen.colors.SlateBlue}; [10] = {foreground = Screen.colors.SlateBlue};

View File

@@ -869,8 +869,8 @@ describe('float window', function()
[24] = {foreground = Screen.colors.Black, background = Screen.colors.Grey80}; [24] = {foreground = Screen.colors.Black, background = Screen.colors.Grey80};
[25] = {blend = 100, background = Screen.colors.Gray0}; [25] = {blend = 100, background = Screen.colors.Gray0};
[26] = {blend = 80, background = Screen.colors.Gray0}; [26] = {blend = 80, background = Screen.colors.Gray0};
[27] = {background = Screen.colors.LightGray}; [27] = {foreground = Screen.colors.Black, background = Screen.colors.LightGrey};
[28] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGray}; [28] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey};
} }
screen:set_default_attr_ids(attrs) screen:set_default_attr_ids(attrs)
end) end)
@@ -7448,8 +7448,8 @@ describe('float window', function()
[10] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 0}, [10] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 0},
[11] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 80}, [11] = {foreground = Screen.colors.Red, background = Screen.colors.LightMagenta, blend = 80},
[12] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue1, blend = 30}, [12] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue1, blend = 30},
[13] = {background = Screen.colors.LightGray, blend = 30}, [13] = {foreground = Screen.colors.Black, background = Screen.colors.LightGray, blend = 30},
[14] = {foreground = Screen.colors.Grey0, background = Screen.colors.Grey88}, [14] = {foreground = Screen.colors.Black, background = Screen.colors.Grey88},
[15] = {foreground = tonumber('0x939393'), background = Screen.colors.Grey88}, [15] = {foreground = tonumber('0x939393'), background = Screen.colors.Grey88},
[16] = {background = Screen.colors.Grey90}; [16] = {background = Screen.colors.Grey90};
[17] = {blend = 100}; [17] = {blend = 100};

View File

@@ -44,7 +44,7 @@ describe('folded lines', function()
[13] = { foreground = Screen.colors.Red, background = Screen.colors.LightGrey }, [13] = { foreground = Screen.colors.Red, background = Screen.colors.LightGrey },
[14] = { background = Screen.colors.Red }, [14] = { background = Screen.colors.Red },
[15] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Red }, [15] = { foreground = Screen.colors.DarkBlue, background = Screen.colors.Red },
[16] = { background = Screen.colors.LightGrey }, [16] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[17] = { background = Screen.colors.Yellow, foreground = Screen.colors.Red }, [17] = { background = Screen.colors.Yellow, foreground = Screen.colors.Red },
[18] = { [18] = {
background = Screen.colors.LightGrey, background = Screen.colors.LightGrey,
@@ -2254,7 +2254,7 @@ describe('folded lines', function()
end) end)
it('Folded and Visual highlights are combined #19691', function() it('Folded and Visual highlights are combined #19691', function()
command('hi! Visual guibg=Red') command('hi! Visual guifg=NONE guibg=Red')
insert([[ insert([[
" foofoofoofoofoofoo " foofoofoofoofoofoo
" 口 {{{1 " 口 {{{1
@@ -2563,7 +2563,7 @@ describe('folded lines', function()
eq('▶--\tsentence composed by', fn.foldtextresult(3)) eq('▶--\tsentence composed by', fn.foldtextresult(3))
eq('▶--\tin his cave.', fn.foldtextresult(5)) eq('▶--\tin his cave.', fn.foldtextresult(5))
command('hi! Visual guibg=Red') command('hi! Visual guifg=NONE guibg=Red')
feed('V2k') feed('V2k')
if multigrid then if multigrid then
screen:expect([[ screen:expect([[
@@ -2677,7 +2677,7 @@ describe('folded lines', function()
]]) ]])
end end
command('hi! Visual guibg=Red') command('hi! Visual guifg=NONE guibg=Red')
feed('V2k') feed('V2k')
if multigrid then if multigrid then
screen:expect([[ screen:expect([[

View File

@@ -317,8 +317,8 @@ describe('highlight', function()
local screen = Screen.new(45, 5) local screen = Screen.new(45, 5)
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = { background = Screen.colors.LightGrey }, [1] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[2] = { bold = true, foreground = Screen.colors.Blue1 }, [2] = { bold = true, foreground = Screen.colors.Blue },
[3] = { bold = true }, [3] = { bold = true },
[4] = { reverse = true, bold = true }, [4] = { reverse = true, bold = true },
[5] = { reverse = true }, [5] = { reverse = true },
@@ -833,41 +833,20 @@ describe("'listchars' highlight", function()
it("'listchar' in visual mode", function() it("'listchar' in visual mode", function()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[1] = { background = Screen.colors.Grey90 }, [1] = { background = Screen.colors.Grey90 },
[2] = { [2] = { foreground = Screen.colors.Red, background = Screen.colors.Grey90 },
foreground = Screen.colors.Red, [3] = { background = Screen.colors.Grey90, foreground = Screen.colors.Blue, bold = true },
background = Screen.colors.Grey90, [4] = { foreground = Screen.colors.Blue, bold = true },
}, [5] = { foreground = Screen.colors.Red },
[3] = { [6] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
background = Screen.colors.Grey90, [7] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Red },
foreground = Screen.colors.Blue, [8] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Blue, bold = true },
bold = true,
},
[4] = {
foreground = Screen.colors.Blue,
bold = true,
},
[5] = {
foreground = Screen.colors.Red,
},
[6] = {
background = Screen.colors.LightGrey,
},
[7] = {
background = Screen.colors.LightGrey,
foreground = Screen.colors.Red,
},
[8] = {
background = Screen.colors.LightGrey,
foreground = Screen.colors.Blue,
bold = true,
},
}) })
feed_command('highlight clear ModeMsg') command('highlight clear ModeMsg')
feed_command('highlight Whitespace guifg=#FF0000') command('highlight Whitespace guifg=#FF0000')
feed_command('set cursorline') command('set cursorline')
feed_command('set tabstop=8') command('set tabstop=8')
feed_command('set nowrap') command('set nowrap')
feed_command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list') command('set listchars=space:.,eol:¬,tab:>-,extends:>,precedes:<,trail:* list')
feed('i\t abcd <cr>\t abcd Lorem ipsum dolor sit amet<cr><esc>kkk0') feed('i\t abcd <cr>\t abcd Lorem ipsum dolor sit amet<cr><esc>kkk0')
screen:expect([[ screen:expect([[
{2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }| {2:^>-------.}{1:abcd}{2:*}{3:¬}{1: }|
@@ -1200,7 +1179,7 @@ describe('CursorLine and CursorLineNr highlights', function()
[6] = { bold = true, foreground = Screen.colors.Blue1 }, [6] = { bold = true, foreground = Screen.colors.Blue1 },
[7] = { background = Screen.colors.LightRed }, [7] = { background = Screen.colors.LightRed },
[8] = { foreground = Screen.colors.Brown }, [8] = { foreground = Screen.colors.Brown },
[9] = { background = Screen.colors.LightGrey }, [9] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[10] = { bold = true }, [10] = { bold = true },
}) })
screen:attach() screen:attach()

View File

@@ -22,7 +22,7 @@ describe('ui/mouse/input', function()
screen:attach() screen:attach()
screen:set_default_attr_ids({ screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue }, [0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { background = Screen.colors.LightGrey }, [1] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
[2] = { bold = true }, [2] = { bold = true },
[3] = { [3] = {
foreground = Screen.colors.Blue, foreground = Screen.colors.Blue,
@@ -561,7 +561,7 @@ describe('ui/mouse/input', function()
tab = { background = Screen.colors.LightGrey, underline = true }, tab = { background = Screen.colors.LightGrey, underline = true },
sel = { bold = true }, sel = { bold = true },
fill = { reverse = true }, fill = { reverse = true },
vis = { background = Screen.colors.LightGrey }, vis = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black },
}) })
feed_command('silent file foo | tabnew | file bar') feed_command('silent file foo | tabnew | file bar')
insert('this is bar') insert('this is bar')

View File

@@ -36,7 +36,7 @@ describe('ext_multigrid', function()
[17] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta}, [17] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta},
[18] = {bold = true, foreground = Screen.colors.Magenta}, [18] = {bold = true, foreground = Screen.colors.Magenta},
[19] = {foreground = Screen.colors.Brown}, [19] = {foreground = Screen.colors.Brown},
[20] = {background = Screen.colors.LightGrey}, [20] = {background = Screen.colors.LightGrey, foreground = Screen.colors.Black},
[21] = {background = Screen.colors.LightMagenta}, [21] = {background = Screen.colors.LightMagenta},
[22] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue}, [22] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue},
[23] = {background = Screen.colors.Grey90}, [23] = {background = Screen.colors.Grey90},

View File

@@ -20,7 +20,7 @@ describe('Screen', function()
[3] = { reverse = true }, [3] = { reverse = true },
[4] = { bold = true }, [4] = { bold = true },
[5] = { background = Screen.colors.Yellow }, [5] = { background = Screen.colors.Yellow },
[6] = { background = Screen.colors.LightGrey }, [6] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
}) })
end) end)

View File

@@ -24,7 +24,7 @@ describe('winbar', function()
[4] = { bold = true, reverse = true }, [4] = { bold = true, reverse = true },
[5] = { bold = true, foreground = Screen.colors.Red }, [5] = { bold = true, foreground = Screen.colors.Red },
[6] = { foreground = Screen.colors.Blue }, [6] = { foreground = Screen.colors.Blue },
[7] = { background = Screen.colors.LightGrey }, [7] = { foreground = Screen.colors.Black, background = Screen.colors.LightGrey },
[8] = { background = Screen.colors.LightMagenta }, [8] = { background = Screen.colors.LightMagenta },
[9] = { [9] = {
bold = true, bold = true,