From 3cae0e3d96a5436735ab34327fc5c20e0cc864ee Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 26 Feb 2023 03:09:29 +0200 Subject: [PATCH] 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). --- lisp/progmodes/python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8220e3086fd..5aab31c3ea8 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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))) -- 2.39.5