From b028d4f7dfbd72790679423a8dcce9994b07834d Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Thu, 3 Nov 2022 19:37:55 -0700 Subject: [PATCH] ; Tree-sitter: Don't refontify if entity contained in the region * lisp/treesit.el (treesit-font-lock-contextual-post-process): Only refontify when NODE-START < region START. --- lisp/treesit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/treesit.el b/lisp/treesit.el index d6058cdc43f..7d961476cd7 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -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. -- 2.39.5