From ff339e1afa8076251af199e31a4bfd7b0f357800 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Tue, 17 Dec 2024 12:14:29 +0100 Subject: [PATCH] Fix treesit-font-lock-level in python-ts-mode Now that 'treesit-font-lock-level' can be a number or a list, it should be handled using 'treesit--compute-font-lock-level'. * lisp/progmodes/python.el (python--treesit-fontify-string): Apply 'treesit--compute-font-lock-level' to 'treesit-font-lock-level'. (cherry picked from commit 78736420746e78445d4ff1889b56c85b66ca794e) --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b59f493b75d..71591af2118 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1102,7 +1102,8 @@ fontified." (ignore-interpolation (not (seq-some (lambda (feats) (memq 'string-interpolation feats)) - (seq-take treesit-font-lock-feature-list treesit-font-lock-level)))) + (seq-take treesit-font-lock-feature-list + (treesit--compute-font-lock-level treesit-font-lock-level))))) ;; If interpolation is enabled, highlight only ;; string_start/string_content/string_end children. Do not ;; touch interpolation node that can occur inside of the -- 2.39.5