From: Yuan Fu Date: Tue, 19 Sep 2023 03:47:50 +0000 (-0700) Subject: Fix treesit--update-ranges-local X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fc7c1f1e93e48ea17657da247590439bff831798;p=emacs.git Fix treesit--update-ranges-local * lisp/treesit.el (treesit--update-ranges-local): Don't forget to set local parser's range when creating it. --- diff --git a/lisp/treesit.el b/lisp/treesit.el index 00a19f6188f..f0d6f32b421 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -681,7 +681,9 @@ parser for EMBEDDED-LANG." (let ((embedded-parser (treesit-parser-create embedded-lang nil t 'embedded)) (ov (make-overlay beg end nil nil t))) - (overlay-put ov 'treesit-parser embedded-parser))))))) + (overlay-put ov 'treesit-parser embedded-parser) + (treesit-parser-set-included-ranges + embedded-parser `((,beg . ,end))))))))) (defun treesit-update-ranges (&optional beg end) "Update the ranges for each language in the current buffer.