diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-08-19 19:15:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-19 19:15:16 +0200 |
commit | 69741107e6910351ae040714246cccaddbca30ae (patch) | |
tree | 5e374bf1d5372cac2e574eb46cce4c55a301e56d | |
parent | ff0833cb4eda9f27ec8748f388b151d785307359 (diff) | |
parent | 2460f0a7028550ea2d87492a4e8b95914fdba7b1 (diff) | |
download | rneovim-69741107e6910351ae040714246cccaddbca30ae.tar.gz rneovim-69741107e6910351ae040714246cccaddbca30ae.tar.bz2 rneovim-69741107e6910351ae040714246cccaddbca30ae.zip |
Merge pull request #15429 from bfredl/hl_2
perf(treesitter): avoid string lookup of highlight name in hot loop
-rw-r--r-- | runtime/lua/vim/treesitter/highlighter.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua index e003cf577a..bf5bd791c3 100644 --- a/runtime/lua/vim/treesitter/highlighter.lua +++ b/runtime/lua/vim/treesitter/highlighter.lua @@ -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 }) |