aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/treesitter.txt9
-rw-r--r--runtime/lua/vim/treesitter/highlighter.lua2
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/treesitter.txt b/runtime/doc/treesitter.txt
index 7f644486f7..aaf13d1640 100644
--- a/runtime/doc/treesitter.txt
+++ b/runtime/doc/treesitter.txt
@@ -136,6 +136,15 @@ tsnode:has_error() *tsnode:has_error()*
tsnode:sexpr() *tsnode:sexpr()*
Get an S-expression representing the node as a string.
+tsnode:id() *tsnode:id()*
+ Get an unique identier for the node inside its own tree.
+
+ No guarantees are made about this identifer's internal representation,
+ except for being a primitive lua type with value equality (so not a table).
+ Presently it is a (non-printable) string.
+
+ NB: the id is not guaranteed to be unique for nodes from different trees.
+
tsnode:descendant_for_range({start_row}, {start_col}, {end_row}, {end_col})
*tsnode:descendant_for_range()*
Get the smallest node within this node that spans the given range of
diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
index decde08019..6714bb6354 100644
--- a/runtime/lua/vim/treesitter/highlighter.lua
+++ b/runtime/lua/vim/treesitter/highlighter.lua
@@ -157,7 +157,7 @@ local function on_line_impl(self, buf, line)
a.nvim_buf_set_extmark(buf, ns, start_row, start_col,
{ end_line = end_row, end_col = end_col,
hl_group = hl,
- ephemeral = true
+ ephemeral = true,
})
end
if start_row > line then