]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix comment/else indentation problem in python-mode
authorStephen Berman <stephen.berman@gmx.net>
Wed, 27 Jul 2022 09:37:31 +0000 (11:37 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 27 Jul 2022 09:37:31 +0000 (11:37 +0200)
* lisp/progmodes/python.el
(python-info-dedenter-opening-block-positions): Fix indentation of
"else" after a comment (bug#56742).

lisp/progmodes/python.el

index ec7d65722009636a5ff99a350613a3b3ca617e8d..b8fc7d4c5468ad47dd9fce2e29c744f195b53e05 100644 (file)
@@ -5171,7 +5171,8 @@ likely an invalid python file."
                                  (while (and (< (point) cur-line)
                                              (setq no-back-indent
                                                    (or (> (current-indentation) indentation)
-                                                       (python-info-current-line-empty-p))))
+                                                       (python-info-current-line-empty-p)
+                                                       (python-info-current-line-comment-p))))
                                    (forward-line)))
                                no-back-indent)))
                   (setq collected-indentations