From ec63146bfcb54c78af7fac3cb0791b94cb1a43ca Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Tue, 17 Dec 2024 12:14:29 +0100 Subject: [PATCH] python-ts-mode now handles the treesit-font-lock-level correctly. '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'. --- 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 dca0936c826..de1c6f551c4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1108,7 +1108,8 @@ python--treesit-fontify-string (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.47.1