From 671e5d9fad5852165f4e63992c91cd6f8c715004 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Thu, 2 Feb 2023 18:54:49 -0800 Subject: [PATCH] ; * lisp/treesit.el (treesit--font-lock-level-setter): Minor change. --- lisp/treesit.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index 98f446a1456..6426eb08fe6 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -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))))))))) -- 2.39.5