]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix fontifying type hints in python-mode
authorkobarity <kobarity@gmail.com>
Sun, 17 Apr 2022 17:28:15 +0000 (19:28 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 17 Apr 2022 17:28:15 +0000 (19:28 +0200)
* lisp/progmodes/python.el
(python-font-lock-keywords-maximum-decoration): Avoid fontifying
type hints as variable names (bug#54992).

Copyright-paperwork-exempt: yes

lisp/progmodes/python.el

index c4d8b123a8672bf270355e858195133f881af6ec..f355055806cb1ac48257dd107189687cfb65f05d 100644 (file)
@@ -706,7 +706,8 @@ avoid '==' being treated as an assignment."
     ;;   [a] = 5
     ;;   [*a] = 5, 6
     (,(python-font-lock-assignment-matcher
-       (python-rx (or "[" "(") (* space)
+       (python-rx (or line-start ?\;) (* space)
+                  (or "[" "(") (* space)
                   grouped-assignment-target (* space)
                   (or ")" "]") (* space)
                   assignment-operator))