mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-11 08:41:48 -07:00
(treesit--font-lock-level-setter): Work a bit more lazily
* lisp/treesit.el (treesit--font-lock-level-setter): Use `font-lock-flush` (as discused in bug#80626). (treesit-font-lock-fontify-region): Simplify a bit.
This commit is contained in:
parent
d88bcc5e2e
commit
c1c08f3c9f
1 changed files with 3 additions and 5 deletions
|
|
@ -1437,8 +1437,7 @@ fontification is enabled."
|
|||
;; `treesit-font-lock-recompute-features') is lost.
|
||||
(when treesit-font-lock-settings
|
||||
(treesit-font-lock-recompute-features)
|
||||
(treesit-font-lock-fontify-region
|
||||
(point-min) (point-max)))))))
|
||||
(font-lock-flush))))))
|
||||
|
||||
(defcustom treesit-font-lock-level 3
|
||||
"Decoration level to be used by tree-sitter fontifications.
|
||||
|
|
@ -2050,9 +2049,8 @@ If LOUDLY is non-nil, display some debugging information."
|
|||
(pcase-let ((`(,max-depth ,max-width)
|
||||
(treesit-subtree-stat
|
||||
(treesit-buffer-root-node language))))
|
||||
(if (or (> max-depth 100) (> max-width 4000))
|
||||
(setq treesit--font-lock-fast-mode t)
|
||||
(setq treesit--font-lock-fast-mode nil))))
|
||||
(setq treesit--font-lock-fast-mode
|
||||
(or (> max-depth 100) (> max-width 4000)))))
|
||||
|
||||
;; Only activate if ENABLE flag is t.
|
||||
(when-let*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue