]> git.eshelyaron.com Git - emacs.git/commitdiff
Set jit-lock-contextually in treesit-major-mode-setup
authorYuan Fu <casouri@gmail.com>
Mon, 31 Oct 2022 03:53:44 +0000 (20:53 -0700)
committerYuan Fu <casouri@gmail.com>
Mon, 31 Oct 2022 03:53:44 +0000 (20:53 -0700)
* lisp/treesit.el (treesit-major-mode-setup): Set jit-lock-contextually.

lisp/treesit.el

index 177c185c74581e2957713c587177e945c8a86b70..4bba2218327530d3d2aeb017913827d973e8c707 100644 (file)
@@ -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.