]> git.eshelyaron.com Git - emacs.git/commit
Enhance Python font-lock to support multilines
authorkobarity <kobarity@gmail.com>
Wed, 17 Aug 2022 11:10:16 +0000 (13:10 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 17 Aug 2022 11:10:16 +0000 (13:10 +0200)
commit4915ca5dd4245a909c046e6691e8d4a1919890c8
treea48242b42ff526acd35579ff0596e0add4887949
parent31e32212670f5774a6dbc0debac8854fa01d8f92
Enhance Python font-lock to support multilines

* test/lisp/progmodes/python-tests.el
(python-tests-assert-faces-after-change): New helper function.
(python-font-lock-keywords-level-1-3)
(python-font-lock-assignment-statement-multiline-*): New tests.

* lisp/progmodes/python.el (python-rx): Add `sp-nl' to represent
space or newline (with/without backslash).
(python-font-lock-keywords-level-1)
(python-font-lock-keywords-maximum-decoration): Allow newlines
where appropriate.
(python-font-lock-extend-region): New function.
(python-mode): Set `python-font-lock-extend-region' to
`font-lock-extend-after-change-region-function'.
lisp/progmodes/python.el
test/lisp/progmodes/python-tests.el