* lisp/treesit.el (treesit-end-of-defun): Guard arg against nil (bug#62158).

This commit is contained in:
Dmitry Gutov 2023-03-20 20:18:42 +02:00 committed by Juri Linkov
parent 263d6c3853
commit 7a1272168a

View file

@ -1882,6 +1882,7 @@ this function depends on `treesit-defun-type-regexp' and
`treesit-defun-skipper'."
(interactive "^p\nd")
(let ((orig-point (point)))
(if (or (null arg) (= arg 0)) (setq arg 1))
(catch 'done
(dotimes (_ 2) ; Not making progress is better than infloop.