aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-09-04 16:39:48 +0200
committerGitHub <noreply@github.com>2020-09-04 16:39:48 +0200
commitef5a09d4fc6b87343755db681dbc1c339b428296 (patch)
treedbf9bff6b291d8f6c978a79d44ba92320b296fc3 /runtime/lua/vim
parentdd465bbccc72665a8e4dbfde09aa7f866b328fef (diff)
parent1832d18083446255aa04d63fac033aea08a65ed0 (diff)
downloadrneovim-ef5a09d4fc6b87343755db681dbc1c339b428296.tar.gz
rneovim-ef5a09d4fc6b87343755db681dbc1c339b428296.tar.bz2
rneovim-ef5a09d4fc6b87343755db681dbc1c339b428296.zip
Merge pull request #12816 from vigoux/decorations
New Decorations API (not finalized, but we gonna build on this)
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index 681d2c6324..bb78b5654c 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -98,7 +98,7 @@ function TSHighlighter:get_hl_from_capture(capture)
return vim.split(name, '.', true)[1]
else
-- Default to false to avoid recomputing
- return TSHighlighter.hl_map[name]
+ return a.nvim_get_hl_id_by_name(TSHighlighter.hl_map[name])
end
end
@@ -142,10 +142,11 @@ function TSHighlighter:on_changedtree(changes)
local start_row, start_col, end_row, end_col = node:range()
local hl = self.hl_cache[capture]
if hl then
- a.nvim__buf_add_decoration(self.buf, ts_hs_ns, hl,
- start_row, start_col,
- end_row, end_col,
- {})
+ a.nvim_buf_set_extmark(self.buf, ts_hs_ns, start_row, start_col, {
+ end_col = end_col,
+ end_line = end_row,
+ hl_group = hl
+ })
end
end
end