diff options
| author | Akin Sowemimo <22454918+akinsho@users.noreply.github.com> | 2022-08-31 19:08:27 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-08-31 12:03:08 -0700 |
| commit | 65d0818fede50cb92697701a6afb1c77c7c33ae8 (patch) | |
| tree | 1d40383841ac7d09bd8572da281ed5d47bdca7a0 /lua/nvim-treesitter | |
| parent | 501db1459a7a46cb0766b3c56e9a6904bbcbcc97 (diff) | |
fix(highlight): ensure links are rebuilt on colorscheme change
Diffstat (limited to 'lua/nvim-treesitter')
| -rw-r--r-- | lua/nvim-treesitter/highlight.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua index 9c4ede21..c50c4f89 100644 --- a/lua/nvim-treesitter/highlight.lua +++ b/lua/nvim-treesitter/highlight.lua @@ -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 }, |
