[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/tree-sitter 52c8fdde16 2/5: Set jit-lock-contextually in treesit
From: |
Yuan Fu |
Subject: |
feature/tree-sitter 52c8fdde16 2/5: Set jit-lock-contextually in treesit-major-mode-setup |
Date: |
Mon, 31 Oct 2022 03:24:25 -0400 (EDT) |
branch: feature/tree-sitter
commit 52c8fdde1667ac4b5d7f2af5eff94d6512d83caa
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Set jit-lock-contextually in treesit-major-mode-setup
* lisp/treesit.el (treesit-major-mode-setup): Set jit-lock-contextually.
---
lisp/treesit.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 177c185c74..4bba221832 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1302,6 +1302,11 @@ If `treesit-defun-type-regexp' is non-nil, setup
(setq-local font-lock-defaults '(nil t))
(setq-local font-lock-fontify-region-function
#'treesit-font-lock-fontify-region)
+ ;; `font-lock-mode' sets this to t when syntactic font-lock is
+ ;; enabled (i.e., `font-lock-keywords-only' is nil). We disable
+ ;; font-lock's syntactic fontification, and do it ourselves, so we
+ ;; still need `jit-lock-contextually' to be t, set it ourselves.
+ (setq-local jit-lock-contextually t)
(font-lock-mode 1)
(treesit-font-lock-recompute-features))
;; Indent.