python-ts-mode: Fix single-quote string fontification

* lisp/progmodes/python.el (python--treesit-fontify-string):
Look for ', not just ", as opening delimiter (bug#61796).
This commit is contained in:
Dmitry Gutov 2023-02-26 03:09:29 +02:00
parent 68d753e371
commit 3cae0e3d96

View file

@ -1070,7 +1070,7 @@ fontified."
;; Don't highlight string prefixes like f/r/b.
(save-excursion
(goto-char string-beg)
(when (search-forward "\"" string-end t)
(when (re-search-forward "[\"']" string-end t)
(setq string-beg (match-beginning 0))))
(treesit-fontify-with-override
string-beg string-end face override start end)))