diff options
| author | Dmitry Gutov | 2023-02-17 17:06:53 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2023-02-17 17:09:29 +0200 |
| commit | 5b34fc07085a4ec636124756d09dcc3be8414eb8 (patch) | |
| tree | c41b71fd4381e0b96bf630d52dabaa248d5d0693 | |
| parent | 1c7d7623781cd7ee5d2ba7c1303e476592ccaee1 (diff) | |
| download | emacs-5b34fc07085a4ec636124756d09dcc3be8414eb8.tar.gz emacs-5b34fc07085a4ec636124756d09dcc3be8414eb8.zip | |
* lisp/treesit.el (treesit-node-at): Update docstring (bug#61529).
| -rw-r--r-- | lisp/treesit.el | 9 |
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." | |||
| 166 | A leaf node is a node that doesn't have any child nodes. | 166 | A leaf node is a node that doesn't have any child nodes. |
| 167 | 167 | ||
| 168 | The returned node's span covers POS: the node's beginning is before | 168 | The returned node's span covers POS: the node's beginning is before |
| 169 | or at POS, and the node's end is at or after POS. | 169 | or at POS, and the node's end is after POS. |
| 170 | 170 | ||
| 171 | If no leaf node's span covers POS (e.g., POS is on whitespace | 171 | If no such node exists, but there's a leaf node which ends at POS, |
| 172 | between two leaf nodes), return the first leaf node after POS. | 172 | return that node. |
| 173 | |||
| 174 | Otherwise (e.g., when POS is on whitespace between two leaf | ||
| 175 | nodes), return the first leaf node after POS. | ||
| 173 | 176 | ||
| 174 | If there is no leaf node after POS, return the first leaf node | 177 | If there is no leaf node after POS, return the first leaf node |
| 175 | before POS. | 178 | before POS. |