]> git.eshelyaron.com Git - emacs.git/commitdiff
; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change.
authorYuan Fu <casouri@gmail.com>
Fri, 3 Feb 2023 02:54:49 +0000 (18:54 -0800)
committerYuan Fu <casouri@gmail.com>
Sat, 4 Feb 2023 23:33:26 +0000 (15:33 -0800)
lisp/treesit.el

index 98f446a14565915cf1510d22625b86f9a6d8153b..6426eb08fe65a30968e18d009eb915e64300668c 100644 (file)
@@ -555,8 +555,12 @@ omitted, default END to BEG."
               "Generic tree-sitter font-lock error"
               'treesit-error)
 
+(defvar treesit-font-lock-settings)
 (defun treesit--font-lock-level-setter (sym val)
-  "Custom setter for `treesit-font-lock-level'."
+  "Custom setter for `treesit-font-lock-level'.
+Set the default value of SYM to VAL, recompute fontification
+features and refontify for every buffer where tree-sitter-based
+fontification is enabled."
   (set-default sym val)
   (and (treesit-available-p)
        (named-let loop ((res nil)
@@ -571,7 +575,7 @@ omitted, default END to BEG."
                    res)
            (let ((buffer (car buffers)))
              (with-current-buffer buffer
-               (if (treesit-parser-list)
+               (if treesit-font-lock-settings
                    (loop (append res (list buffer)) (cdr buffers))
                  (loop res (cdr buffers)))))))))