mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/treesit.el (treesit-show-paren-data--categorize): Improve.
Instead of using only the immediate parent, try to search more levels using 'treesit-parent-until' (bug#75122).
This commit is contained in:
parent
ce74534ef8
commit
dc653bf063
1 changed files with 1 additions and 2 deletions
|
|
@ -3393,8 +3393,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in
|
|||
|
||||
(defun treesit-show-paren-data--categorize (pos &optional end-p)
|
||||
(let* ((pred 'sexp-list)
|
||||
(parent (treesit-node-parent (treesit-node-at (if end-p (1- pos) pos))))
|
||||
(parent (when (treesit-node-match-p parent pred t) parent))
|
||||
(parent (treesit-parent-until (treesit-node-at (if end-p (1- pos) pos)) pred))
|
||||
(first (when parent (treesit-node-child parent 0)))
|
||||
(first-start (when first (treesit-node-start first)))
|
||||
(first-end (when first (treesit-node-end first)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue