aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2023-02-17 17:06:53 +0200
committerDmitry Gutov2023-02-17 17:09:29 +0200
commit5b34fc07085a4ec636124756d09dcc3be8414eb8 (patch)
treec41b71fd4381e0b96bf630d52dabaa248d5d0693
parent1c7d7623781cd7ee5d2ba7c1303e476592ccaee1 (diff)
downloademacs-5b34fc07085a4ec636124756d09dcc3be8414eb8.tar.gz
emacs-5b34fc07085a4ec636124756d09dcc3be8414eb8.zip
* lisp/treesit.el (treesit-node-at): Update docstring (bug#61529).
-rw-r--r--lisp/treesit.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 6015e78bbd5..09531b838a1 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -166,10 +166,13 @@ parser in `treesit-parser-list', or nil if there is no parser."
166A leaf node is a node that doesn't have any child nodes. 166A leaf node is a node that doesn't have any child nodes.
167 167
168The returned node's span covers POS: the node's beginning is before 168The returned node's span covers POS: the node's beginning is before
169or at POS, and the node's end is at or after POS. 169or at POS, and the node's end is after POS.
170 170
171If no leaf node's span covers POS (e.g., POS is on whitespace 171If no such node exists, but there's a leaf node which ends at POS,
172between two leaf nodes), return the first leaf node after POS. 172return that node.
173
174Otherwise (e.g., when POS is on whitespace between two leaf
175nodes), return the first leaf node after POS.
173 176
174If there is no leaf node after POS, return the first leaf node 177If there is no leaf node after POS, return the first leaf node
175before POS. 178before POS.