aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/tshighlighter.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-01-17 22:27:17 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2020-02-10 13:10:15 +0100
commit95fd28f4a1ef4e298695e0204bdb5b347aa0f57c (patch)
tree61728978f5d8570a2a96d10304520f983edbde61 /runtime/lua/vim/tshighlighter.lua
parent6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b (diff)
downloadrneovim-95fd28f4a1ef4e298695e0204bdb5b347aa0f57c.tar.gz
rneovim-95fd28f4a1ef4e298695e0204bdb5b347aa0f57c.tar.bz2
rneovim-95fd28f4a1ef4e298695e0204bdb5b347aa0f57c.zip
treesitter: use internal "decorations" buffer
Diffstat (limited to 'runtime/lua/vim/tshighlighter.lua')
-rw-r--r--runtime/lua/vim/tshighlighter.lua26
1 files changed, 2 insertions, 24 deletions
diff --git a/runtime/lua/vim/tshighlighter.lua b/runtime/lua/vim/tshighlighter.lua
index 1544ecbf49..9d094f0f9a 100644
--- a/runtime/lua/vim/tshighlighter.lua
+++ b/runtime/lua/vim/tshighlighter.lua
@@ -85,7 +85,6 @@ end
function TSHighlighter:on_window(_, _win, _buf, _topline, botline)
self.iter = nil
- self.active_nodes = {}
self.nextrow = 0
self.botline = botline
self.redraw_count = self.redraw_count + 1
@@ -107,34 +106,13 @@ function TSHighlighter:on_line(_, _win, buf, line)
end
local start_row, start_col, end_row, end_col = node:range()
local hl = self.id_map[capture]
- if hl > 0 and active then
- if start_row == line and end_row == line then
- a.nvim__put_attr(hl, start_col, end_col)
- elseif end_row >= line then
- -- TODO(bfredl): this is quite messy. Togheter with multiline bufhl we should support
- -- luahl generating multiline highlights (and other kinds of annotations)
- self.active_nodes[{hl=hl, start_row=start_row, start_col=start_col, end_row=end_row, end_col=end_col}] = true
- end
+ if hl > 0 and active and end_row >= line then
+ a.nvim__put_attr(hl, start_row, start_col, end_row, end_col)
end
if start_row > line then
self.nextrow = start_row
end
end
- for node,_ in pairs(self.active_nodes) do
- if node.start_row <= line and node.end_row >= line then
- local start_col, end_col = node.start_col, node.end_col
- if node.start_row < line then
- start_col = 0
- end
- if node.end_row > line then
- end_col = 9000
- end
- a.nvim__put_attr(node.hl, start_col, end_col)
- end
- if node.end_row <= line then
- self.active_nodes[node] = nil
- end
- end
self.line_count[line] = (self.line_count[line] or 0) + 1
--return tostring(self.line_count[line])
end