1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

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"))
'font-lock-doc-face
'font-lock-string-face)))
(when (eq (char-after string-beg) ?f)
(cl-incf string-beg))
;; Don't highlight string prefixes like f/r/b.
(save-excursion
(goto-char string-beg)
(when (search-forward "\"" string-end t)
(setq string-beg (match-beginning 0))))
(treesit-fontify-with-override
string-beg string-end face override start end)))