diff options
| author | Yuan Fu | 2023-01-07 18:41:28 -0800 |
|---|---|---|
| committer | Yuan Fu | 2023-01-07 18:44:17 -0800 |
| commit | e3d806b4172f16c446bb3c5b31a160ed24fa5244 (patch) | |
| tree | b6fbb56f0023ce88efaaa3ebe67a088c8714c8ca /lisp/progmodes/python.el | |
| parent | 800e15e3be0569efdaa5e42c82937b1c87b7ec58 (diff) | |
| download | emacs-e3d806b4172f16c446bb3c5b31a160ed24fa5244.tar.gz emacs-e3d806b4172f16c446bb3c5b31a160ed24fa5244.zip | |
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.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index e6ded7a0646..21d16db287c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1067,8 +1067,11 @@ fontified." | |||
| 1067 | "expression_statement")) | 1067 | "expression_statement")) |
| 1068 | 'font-lock-doc-face | 1068 | 'font-lock-doc-face |
| 1069 | 'font-lock-string-face))) | 1069 | 'font-lock-string-face))) |
| 1070 | (when (eq (char-after string-beg) ?f) | 1070 | ;; Don't highlight string prefixes like f/r/b. |
| 1071 | (cl-incf string-beg)) | 1071 | (save-excursion |
| 1072 | (goto-char string-beg) | ||
| 1073 | (when (search-forward "\"" string-end t) | ||
| 1074 | (setq string-beg (match-beginning 0)))) | ||
| 1072 | (treesit-fontify-with-override | 1075 | (treesit-fontify-with-override |
| 1073 | string-beg string-end face override start end))) | 1076 | string-beg string-end face override start end))) |
| 1074 | 1077 | ||