* 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)
;; 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)