Merge pull request #15429 from bfredl/hl_2

perf(treesitter): avoid string lookup of highlight name in hot loop
This commit is contained in:
Björn Linse 2021-08-19 19:15:16 +02:00 committed by GitHub
commit 69741107e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
})