fix(highlight): include treesitter injections
Problem: highlight_treesitter only iterated captures from the base language tree (trees[1]:root()). When code contained injected languages (e.g. VimL inside vim.cmd()), those captures were never read, so injected code got no syntax highlighting in diffs. Solution: pass true to parse() to trigger injection discovery, then use parser_obj:for_each_tree() to iterate all trees including injected ones. Each tree gets its own highlights query looked up by ltree:lang(), and @spell/@nospell captures are filtered out.
This commit is contained in:
parent
2b1b1c3be2
commit
0cefa00d27
3 changed files with 121 additions and 26 deletions
|
|
@ -12,6 +12,7 @@ local function ensure_parser(lang)
|
|||
end
|
||||
|
||||
ensure_parser('lua')
|
||||
ensure_parser('vim')
|
||||
|
||||
local M = {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue