From fc7c1f1e93e48ea17657da247590439bff831798 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 18 Sep 2023 20:47:50 -0700 Subject: [PATCH] Fix treesit--update-ranges-local * lisp/treesit.el (treesit--update-ranges-local): Don't forget to set local parser's range when creating it. --- lisp/treesit.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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. -- 2.39.2