From 024a1f1051c4d048effb160b8bea915e62a45378 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 25 Jun 2025 19:45:54 +0300 Subject: [PATCH] Fix usage of 'treesit-defun-type-regexp' in treesit-tests. * test/src/treesit-tests.el (treesit--ert-test-defun-navigation): Replace 'treesit-defun-type-regexp' with '(or treesit-defun-type-regexp 'defun)' that fixes the tests for ts-modes that set up the 'defun' thing instead of 'treesit-defun-type-regexp'. (cherry picked from commit 789a6b969345d6f9e0c8604bff8618d20a6cf536) --- test/src/treesit-tests.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/src/treesit-tests.el b/test/src/treesit-tests.el index c151a86c5e5..b5ea63a53f3 100644 --- a/test/src/treesit-tests.el +++ b/test/src/treesit-tests.el @@ -1138,10 +1138,11 @@ and \"]\"." ;; Four functions: next-end, prev-beg, next-beg, prev-end. (mapcar (lambda (conf) (lambda () - (if-let ((pos (funcall - #'treesit-navigate-thing - (point) (car conf) (cdr conf) - treesit-defun-type-regexp tactic))) + (if-let* ((pos (funcall + #'treesit-navigate-thing + (point) (car conf) (cdr conf) + (or treesit-defun-type-regexp 'defun) + tactic))) (save-excursion (goto-char pos) (funcall treesit-defun-skipper) -- 2.39.5