mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(highlight): add missing g: prefix for colors_name (#22952)
Fix #22951. This was fixed in Vim in patch 8.2.0613.
This commit is contained in:
parent
72d5a13e55
commit
4ce0ada0d4
@ -1003,7 +1003,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
|
||||
// ":highlight clear [group]" command.
|
||||
line = linep;
|
||||
if (ends_excmd((uint8_t)(*line))) {
|
||||
do_unlet(S_LEN("colors_name"), true);
|
||||
do_unlet(S_LEN("g:colors_name"), true);
|
||||
restore_cterm_colors();
|
||||
|
||||
// Clear all default highlight groups and load the defaults.
|
||||
|
@ -3,6 +3,9 @@ local helpers = require("test.functional.helpers")(after_each)
|
||||
local eq, command = helpers.eq, helpers.command
|
||||
local clear = helpers.clear
|
||||
local eval, exc_exec = helpers.eval, helpers.exc_exec
|
||||
local exec = helpers.exec
|
||||
local funcs = helpers.funcs
|
||||
local meths = helpers.meths
|
||||
|
||||
describe(':highlight', function()
|
||||
local screen
|
||||
@ -45,4 +48,20 @@ describe(':highlight', function()
|
||||
eq('', eval('synIDattr(hlID("NonText"), "undercurl", "gui")'))
|
||||
eq('1', eval('synIDattr(hlID("NonText"), "underline", "gui")'))
|
||||
end)
|
||||
|
||||
it('clear', function()
|
||||
meths.set_var('colors_name', 'foo')
|
||||
eq(1, funcs.exists('g:colors_name'))
|
||||
command('hi clear')
|
||||
eq(0, funcs.exists('g:colors_name'))
|
||||
meths.set_var('colors_name', 'foo')
|
||||
eq(1, funcs.exists('g:colors_name'))
|
||||
exec([[
|
||||
func HiClear()
|
||||
hi clear
|
||||
endfunc
|
||||
]])
|
||||
funcs.HiClear()
|
||||
eq(0, funcs.exists('g:colors_name'))
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user