mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 11:25:33 +00:00
treesitter: update to use buf_set_extmark
This commit is contained in:
@@ -98,7 +98,7 @@ function TSHighlighter:get_hl_from_capture(capture)
|
|||||||
return vim.split(name, '.', true)[1]
|
return vim.split(name, '.', true)[1]
|
||||||
else
|
else
|
||||||
-- Default to false to avoid recomputing
|
-- 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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -142,10 +142,11 @@ function TSHighlighter:on_changedtree(changes)
|
|||||||
local start_row, start_col, end_row, end_col = node:range()
|
local start_row, start_col, end_row, end_col = node:range()
|
||||||
local hl = self.hl_cache[capture]
|
local hl = self.hl_cache[capture]
|
||||||
if hl then
|
if hl then
|
||||||
a.nvim__buf_add_decoration(self.buf, ts_hs_ns, hl,
|
a.nvim_buf_set_extmark(self.buf, ts_hs_ns, start_row, start_col, {
|
||||||
start_row, start_col,
|
end_col = end_col,
|
||||||
end_row, end_col,
|
end_line = end_row,
|
||||||
{})
|
hl_group = hl
|
||||||
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user