]> git.eshelyaron.com Git - emacs.git/commitdiff
treesit--pre-syntax-ppss: Fix args-out-of-range in internal--syntax-propertize
authorDmitry Gutov <dmitry@gutov.dev>
Tue, 2 Jan 2024 13:32:03 +0000 (15:32 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 6 Jan 2024 16:15:26 +0000 (17:15 +0100)
* lisp/treesit.el (treesit--pre-syntax-ppss): Make sure the lower
bound is still within the current restriction (bug#67977).

(cherry picked from commit 1a677d1429d1f9fea2d6b2bc9dd5644a5564cc27)

lisp/treesit.el

index a68eed06e41c90ba1af348a694d65dd00f8a6da0..c8b473c7bb8ae5707b39368fc1fc10c5fd55636d 100644 (file)
@@ -1393,7 +1393,7 @@ START and END mark the current to-be-propertized region."
     (if (and new-start (< new-start start))
         (progn
           (setq treesit--syntax-propertize-start nil)
-          (cons new-start end))
+          (cons (max new-start (point-min)) end))
       nil)))
 
 ;;; Indent