Fix string fontification on python-ts-mode (bug#60599)

* lisp/progmodes/python.el:
(python--treesit-fontify-string): Generalize and skip anything
before the first quote character.
This commit is contained in:
Yuan Fu 2023-01-07 18:41:28 -08:00
parent 800e15e3be
commit e3d806b417
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -1067,8 +1067,11 @@ fontified."
"expression_statement")) "expression_statement"))
'font-lock-doc-face 'font-lock-doc-face
'font-lock-string-face))) 'font-lock-string-face)))
(when (eq (char-after string-beg) ?f) ;; Don't highlight string prefixes like f/r/b.
(cl-incf string-beg)) (save-excursion
(goto-char string-beg)
(when (search-forward "\"" string-end t)
(setq string-beg (match-beginning 0))))
(treesit-fontify-with-override (treesit-fontify-with-override
string-beg string-end face override start end))) string-beg string-end face override start end)))