mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 12:20:02 -04:00
fix(highlight): ensure links are rebuilt on colorscheme change
This commit is contained in:
parent
501db1459a
commit
65d0818fed
1 changed files with 7 additions and 2 deletions
|
|
@ -130,8 +130,10 @@ elseif not vim.g.skip_ts_default_groups then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for capture, hlgroup in pairs(default_map) do
|
local function link_all_captures()
|
||||||
link_captures(capture, hlgroup)
|
for capture, hlgroup in pairs(default_map) do
|
||||||
|
link_captures(capture, hlgroup)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function should_enable_vim_regex(config, lang)
|
local function should_enable_vim_regex(config, lang)
|
||||||
|
|
@ -177,6 +179,9 @@ function M.set_custom_captures(captures)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.set_default_hlgroups()
|
function M.set_default_hlgroups()
|
||||||
|
if not ts.highlighter.hl_map then
|
||||||
|
link_all_captures()
|
||||||
|
end
|
||||||
local highlights = {
|
local highlights = {
|
||||||
TSNone = { default = true },
|
TSNone = { default = true },
|
||||||
TSPunctDelimiter = { link = "Delimiter", default = true },
|
TSPunctDelimiter = { link = "Delimiter", default = true },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue