diff options
| -rw-r--r-- | lisp/treesit.el | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lisp/treesit.el b/lisp/treesit.el index 24387c287a7..015f780078f 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el | |||
| @@ -1765,10 +1765,11 @@ to the offending pattern and highlight the pattern." | |||
| 1765 | 1765 | ||
| 1766 | (defun treesit--explorer--nodes-to-highlight (language) | 1766 | (defun treesit--explorer--nodes-to-highlight (language) |
| 1767 | "Return nodes for LANGUAGE covered in region. | 1767 | "Return nodes for LANGUAGE covered in region. |
| 1768 | This function tries to return the largest node possible. So it | 1768 | This function tries to return the largest node possible. If the |
| 1769 | will return a single large node rather than a bunch of small | 1769 | region covers exactly one node, that node is returned (in a |
| 1770 | nodes. If it end up returning multiple small nodes, it only | 1770 | list). If the region covers more than one node, two nodes are |
| 1771 | returns the first and last node, and omits the ones in between." | 1771 | returned: the very first one in the region and the very last one |
| 1772 | in the region." | ||
| 1772 | (let* ((beg (region-beginning)) | 1773 | (let* ((beg (region-beginning)) |
| 1773 | (end (region-end)) | 1774 | (end (region-end)) |
| 1774 | (node (treesit-node-on beg end language)) | 1775 | (node (treesit-node-on beg end language)) |
| @@ -1887,13 +1888,10 @@ Return the start of the syntax tree text corresponding to NODE." | |||
| 1887 | 1888 | ||
| 1888 | (defun treesit--explorer-draw-node (node) | 1889 | (defun treesit--explorer-draw-node (node) |
| 1889 | "Draw the syntax tree of NODE. | 1890 | "Draw the syntax tree of NODE. |
| 1890 | If NODE and NODE-HIGHLIGHT are the same node, highlight it. | ||
| 1891 | 1891 | ||
| 1892 | When this function is called, point should be at an empty line, | 1892 | When this function is called, point should be at the position |
| 1893 | when appropriate indent in front of point. When this function | 1893 | where the node should start. When this function returns, it |
| 1894 | returns, it leaves point at the end of the last line of NODE. | 1894 | leaves point at the end of the last line of NODE." |
| 1895 | |||
| 1896 | Return the start position of NODE-HIGHLIGHT in the buffer, if any." | ||
| 1897 | (let* ((type (treesit-node-type node)) | 1895 | (let* ((type (treesit-node-type node)) |
| 1898 | (field-name (treesit-node-field-name node)) | 1896 | (field-name (treesit-node-field-name node)) |
| 1899 | (children (treesit-node-children node)) | 1897 | (children (treesit-node-children node)) |