From e91f68b74248fe5dd44c130799870ada91c4a28e Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 17 Feb 2026 09:20:16 +0200 Subject: [PATCH] ; * lisp/treesit.el (treesit-hs-find-next-block): Add guard (bug#80422). --- lisp/treesit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 4f40a3055b5..c018afc1e98 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -4313,7 +4313,7 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in (comment-p (and comment-thing (eq beg (treesit-node-start comment-thing)))) (thing (if comment-p comment-thing block-thing)) (end (if thing (min (1+ (treesit-node-start thing)) (point-max))))) - (when (<= end (point)) + (when (and end (<= end (point))) (setq end (treesit-node-end thing))) (when (and end (<= end maxp)) (goto-char end)