mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
perf(treesitter): avoid string lookup of highlight name in hot loop
These numbers are guaranteed to be stable even if you do "highlight clear" (all attributes disappear, but not the id to name mapping itself)
This commit is contained in:
parent
d088066fa1
commit
2460f0a702
@ -85,8 +85,10 @@ function TSHighlighterQuery.new(lang, query_string)
|
||||
hl = _link_default_highlight_once(lang .. hl, hl)
|
||||
end
|
||||
|
||||
rawset(table, capture, hl)
|
||||
return hl
|
||||
local id = a.nvim_get_hl_id_by_name(hl)
|
||||
|
||||
rawset(table, capture, id)
|
||||
return id
|
||||
end
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user