(py-compute-indentation): in `t' clause, watch for the

re-search-backwards landing you inside a mult-line string.
This commit is contained in:
Barry Warsaw 1994-12-16 00:13:34 +00:00
parent 06fe7e5c2c
commit 3ff444992f
1 changed files with 7 additions and 0 deletions

View File

@ -596,6 +596,13 @@ the new line indented."
;; happens to be a continuation line too
(re-search-backward "^[ \t]*\\([^ \t\n#]\\|#[ \t\n]\\)"
nil 'move)
;; if we landed inside a string, go to the beginning of that string
(let ((state (parse-partial-sexp
(save-excursion (beginning-of-python-def-or-class)
(point))
(point))))
(if (nth 3 state)
(goto-char (nth 2 state))))
(py-goto-initial-line)
(if (py-statement-opens-block-p)
(+ (current-indentation) py-indent-offset)