mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(highlight): support color names for cterm
This commit is contained in:
@@ -290,6 +290,10 @@ describe("API: set highlight", function()
|
||||
eq('Test_hl3 xxx ctermfg=12 ctermbg=9',
|
||||
exec_capture('highlight Test_hl3'))
|
||||
|
||||
meths.set_hl(0, 'Test_hl3', { ctermbg = 'red' , ctermfg = 'blue'})
|
||||
eq('Test_hl3 xxx ctermfg=12 ctermbg=9',
|
||||
exec_capture('highlight Test_hl3'))
|
||||
|
||||
meths.set_hl(0, 'Test_hl3', { ctermbg = 9 })
|
||||
eq('Test_hl3 xxx ctermbg=9',
|
||||
exec_capture('highlight Test_hl3'))
|
||||
@@ -297,5 +301,18 @@ describe("API: set highlight", function()
|
||||
meths.set_hl(0, 'Test_hl3', {})
|
||||
eq('Test_hl3 xxx cleared',
|
||||
exec_capture('highlight Test_hl3'))
|
||||
|
||||
eq("'redd' is not a valid color",
|
||||
pcall_err(meths.set_hl, 0, 'Test_hl3', {fg='redd'}))
|
||||
|
||||
eq("'bleu' is not a valid color",
|
||||
pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='bleu'}))
|
||||
|
||||
meths.set_hl(0, 'Test_hl3', {fg='#FF00FF'})
|
||||
eq('Test_hl3 xxx guifg=#FF00FF',
|
||||
exec_capture('highlight Test_hl3'))
|
||||
|
||||
eq("'#FF00FF' is not a valid color",
|
||||
pcall_err(meths.set_hl, 0, 'Test_hl3', {ctermfg='#FF00FF'}))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user