]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix treesit--update-ranges-local
authorYuan Fu <casouri@gmail.com>
Tue, 19 Sep 2023 03:47:50 +0000 (20:47 -0700)
committerYuan Fu <casouri@gmail.com>
Tue, 19 Sep 2023 03:48:28 +0000 (20:48 -0700)
* lisp/treesit.el (treesit--update-ranges-local): Don't forget to set
local parser's range when creating it.

lisp/treesit.el

index 00a19f6188f8e3c2fab310dbf2b0d9412c51c974..f0d6f32b421d7e6f7791d8e27e060a2ced1412a9 100644 (file)
@@ -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.