From: Yuan Fu Date: Thu, 24 Nov 2022 01:24:03 +0000 (-0800) Subject: ; * src/treesit.c (treesit_predicate_match): Move use below check. X-Git-Tag: emacs-29.0.90~1550 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=31fe6b066c39a9a38b0b8bb5bbae9e991ed87b2a;p=emacs.git ; * src/treesit.c (treesit_predicate_match): Move use below check. --- diff --git a/src/treesit.c b/src/treesit.c index 4e07d4d0847..7834eb1a682 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -2229,8 +2229,6 @@ treesit_predicate_match (Lisp_Object args, struct capture_range captures) Lisp_Object regexp = XCAR (args); Lisp_Object capture_name = XCAR (XCDR (args)); - Lisp_Object text = treesit_predicate_capture_name_to_text (capture_name, - captures); /* It's probably common to get the argument order backwards. Catch this mistake early and show helpful explanation, because Emacs @@ -2245,6 +2243,9 @@ treesit_predicate_match (Lisp_Object args, struct capture_range captures) build_pure_c_string ("The second argument to `match' should " "be a capture name, not a string")); + Lisp_Object text = treesit_predicate_capture_name_to_text (capture_name, + captures); + if (fast_string_match (regexp, text) >= 0) return true; else