[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f1e2d36: Revert "Indent python multiline strings to start and pre
From: |
Lars Ingebrigtsen |
Subject: |
master f1e2d36: Revert "Indent python multiline strings to start and previous levels" |
Date: |
Sun, 9 Aug 2020 17:52:00 -0400 (EDT) |
branch: master
commit f1e2d366e5ff30c72ab92d38dacd14b544324066
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Revert "Indent python multiline strings to start and previous levels"
This reverts commit b78583cde7d8aaa1fa19c20975c03d689c78baef.
The multi-line string indentation was incorrect after applying this patch.
---
lisp/progmodes/python.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index dcdadae..3af55be 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1070,18 +1070,11 @@ possibilities can be narrowed to specific indentation
points."
(`(:no-indent . ,_) (prog-first-column)) ; usually 0
(`(,(or :after-line
:after-comment
+ :inside-string
:after-backslash) . ,start)
;; Copy previous indentation.
(goto-char start)
(current-indentation))
- (`(,(or :inside-string
- :inside-docstring) . ,start)
- ;; Copy previous indentation inside string
- (let ((prev (progn (forward-line -1)
- (current-indentation)))
- (base (progn (goto-char start)
- (current-column))))
- (sort (delete-dups (list 0 prev base)) #'<)))
(`(,(or :inside-paren-at-closing-paren
:inside-paren-at-closing-nested-paren) . ,start)
(goto-char (+ 1 start))
@@ -1090,6 +1083,12 @@ possibilities can be narrowed to specific indentation
points."
(current-indentation)
;; Align with opening paren.
(current-column)))
+ (`(:inside-docstring . ,start)
+ (let* ((line-indentation (current-indentation))
+ (base-indent (progn
+ (goto-char start)
+ (current-indentation))))
+ (max line-indentation base-indent)))
(`(,(or :after-block-start
:after-backslash-first-line
:after-backslash-assignment-continuation
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f1e2d36: Revert "Indent python multiline strings to start and previous levels",
Lars Ingebrigtsen <=