Commit 3fc1d77a authored by Tommi Komulainen's avatar Tommi Komulainen Committed by Noam Postavsky
Browse files

python.el: Fix close paren indentation to match pep8 (Bug#20742)

* lisp/progmodes/python.el (python-indent--calculate-indentation):
When opening paren is followed by newline the closing paren should
follow the current indentation.  Otherwise the closing paren should be
aligned with the opening paren.  This fixes the latter case.

Copyright-paperwork-exempt: yes
parent 9469d58e
......@@ -1070,12 +1070,18 @@ possibilities can be narrowed to specific indentation points."
(`(,(or :after-line
:inside-paren-at-closing-nested-paren) . ,start)
:after-backslash) . ,start)
;; Copy previous indentation.
(goto-char start)
(`(,(or :inside-paren-at-closing-paren
:inside-paren-at-closing-nested-paren) . ,start)
(goto-char (+ 1 start))
(if (looking-at "[ \t]*\\(?:#\\|$\\)")
;; Copy previous indentation.
;; Align with opening paren.
(`(:inside-docstring . ,start)
(let* ((line-indentation (current-indentation))
(base-indent (progn
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment