Use treesit-node-match-p in treesit-parent-while

The previous commit should've done this, but I missed it.

* lisp/treesit.el (treesit-parent-while): Use treesit-node-match-p.
This commit is contained in:
Yuan Fu 2024-02-05 23:12:36 -08:00
parent 10faaa3c91
commit cebd26b2e1
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -366,7 +366,7 @@ returns nil.
PRED can be a predicate function, a regexp matching node type,
and more; see docstring of `treesit-thing-settings'."
(let ((last nil))
(while (and node (funcall pred node))
(while (and node (treesit-node-match-p node pred))
(setq last node
node (treesit-node-parent node)))
last))