; * lisp/treesit.el (treesit-hs-find-next-block): Add guard (bug#80422).

This commit is contained in:
Juri Linkov 2026-02-17 09:20:16 +02:00
parent 988e898749
commit e91f68b742

View file

@ -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)