fix(highlight): ensure links are rebuilt on colorscheme change

This commit is contained in:
Akin Sowemimo 2022-08-31 19:08:27 +01:00 committed by Stephan Seitz
parent 501db1459a
commit 65d0818fed

View file

@ -130,8 +130,10 @@ elseif not vim.g.skip_ts_default_groups then
end
end
for capture, hlgroup in pairs(default_map) do
link_captures(capture, hlgroup)
local function link_all_captures()
for capture, hlgroup in pairs(default_map) do
link_captures(capture, hlgroup)
end
end
local function should_enable_vim_regex(config, lang)
@ -177,6 +179,9 @@ function M.set_custom_captures(captures)
end
function M.set_default_hlgroups()
if not ts.highlighter.hl_map then
link_all_captures()
end
local highlights = {
TSNone = { default = true },
TSPunctDelimiter = { link = "Delimiter", default = true },