]> git.eshelyaron.com Git - emacs.git/commitdiff
Use treesit-node-match-p in treesit-parent-while
authorYuan Fu <casouri@gmail.com>
Tue, 6 Feb 2024 07:12:36 +0000 (23:12 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 7 Feb 2024 10:54:30 +0000 (11:54 +0100)
The previous commit should've done this, but I missed it.

* lisp/treesit.el (treesit-parent-while): Use treesit-node-match-p.

(cherry picked from commit cebd26b2e16d75a939e2a9f91becc6ec702122a7)

lisp/treesit.el

index f179204d89c0b8051c429c09481e0d561381bd6f..6a485ae591ab8e6b7d8510f630ae005b936f1537 100644 (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))