mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 13:30:01 -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
|
||||
|
||||
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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue