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.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 22a4e2c2e5d..3f86c112265 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1122,12 +1122,13 @@ fontified."
1122 "body")) 1122 "body"))
1123 (throw 'break 'font-lock-doc-face)) 1123 (throw 'break 'font-lock-doc-face))
1124 1124
1125 (let ((idx 0)) 1125 ;; If there's any non-comment sibling before
1126 (while (< idx cursor-idx) 1126 ;; cursor, the string isn't a docstring.
1127 (unless (equal (treesit-node-type 1127 (dotimes (idx cursor-idx)
1128 (treesit-node-child parent idx)) 1128 (unless (equal (treesit-node-type
1129 "comment") 1129 (treesit-node-child parent idx))
1130 (throw 'break 'font-lock-string-face)))) 1130 "comment")
1131 (throw 'break 'font-lock-string-face)))
1131 (setq cursor parent))))) 1132 (setq cursor parent)))))
1132 (ignore-interpolation 1133 (ignore-interpolation
1133 (not (seq-some 1134 (not (seq-some