aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el10
1 files changed, 2 insertions, 8 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 46559db2cd1..603cdb14e15 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1035,12 +1035,6 @@ f for f-strings. OVERRIDE is the override flag described in
1035 (cl-incf string-beg)) 1035 (cl-incf string-beg))
1036 (treesit-fontify-with-override string-beg string-end face override))) 1036 (treesit-fontify-with-override string-beg string-end face override)))
1037 1037
1038(defun python--treesit-fontify-string-end (node &rest _)
1039 "Mark the whole string as to-be-fontified.
1040NODE is the ending quote of a string."
1041 (let ((string (treesit-node-parent node)))
1042 (setq jit-lock-context-unfontify-pos (treesit-node-start string))))
1043
1044(defvar python--treesit-settings 1038(defvar python--treesit-settings
1045 (treesit-font-lock-rules 1039 (treesit-font-lock-rules
1046 :feature 'comment 1040 :feature 'comment
@@ -1051,8 +1045,8 @@ NODE is the ending quote of a string."
1051 :language 'python 1045 :language 'python
1052 :override t 1046 :override t
1053 ;; TODO Document on why we do this. 1047 ;; TODO Document on why we do this.
1054 '((string "\"" @python--treesit-fontify-string-end :anchor) 1048 '((string :anchor "\"" @python--treesit-fontify-string)
1055 (string :anchor "\"" @python--treesit-fontify-string :anchor)) 1049 (string) @contextual)
1056 1050
1057 :feature 'string-interpolation 1051 :feature 'string-interpolation
1058 :language 'python 1052 :language 'python