]> git.eshelyaron.com Git - emacs.git/commitdiff
; Tree-sitter: Don't refontify if entity contained in the region
authorYuan Fu <casouri@gmail.com>
Fri, 4 Nov 2022 02:37:55 +0000 (19:37 -0700)
committerYuan Fu <casouri@gmail.com>
Fri, 4 Nov 2022 02:37:55 +0000 (19:37 -0700)
* lisp/treesit.el (treesit-font-lock-contextual-post-process): Only
refontify when NODE-START < region START.

lisp/treesit.el

index d6058cdc43f16f37c40bb191154a4305dc91f2e8..7d961476cd73b9e4479330d1a8894b8b7a511681 100644 (file)
@@ -696,7 +696,7 @@ If VERBOSE is non-nil, print debugging information."
     (when verbose
       (message "Contextual: region: %s-%s, node: %s-%s"
                start end node-start node-end))
-    (when (<= node-end end)
+    (when (and (< node-start start) (<= node-end end))
       (if (get-text-property node-end-1 prop-sym)
           ;; We are called from a refontification by jit-lock-context,
           ;; caused by a previous call to this function.