Indentation enhancements on after-backslash

Multiline sentences beginning with "import", "from" or "return" are
indented correctly now.
This commit is contained in:
Fabián Ezequiel Gallina 2012-05-17 00:03:18 -03:00 committed by Fabián Ezequiel Gallina
parent f8994527d4
commit 9787f82961

View file

@ -681,14 +681,15 @@ START is the buffer position where the sexp starts."
(current-column))
(t
(goto-char context-start)
(if (not (member
(save-excursion
(back-to-indentation)
(message (current-word)))
'("return" "import" "from")))
(if (not
(save-excursion
(back-to-indentation)
(looking-at
"\\(?:return\\|from\\|import\\)\s+")))
(current-indentation)
(+ (current-indentation)
python-indent-offset))))))
(length
(match-string-no-properties 0))))))))
indentation))
('inside-paren
(or (save-excursion