diff options
author | Barry Warsaw <barry@python.org> | 1994-12-16 00:13:34 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1994-12-16 00:13:34 (GMT) |
commit | 3ff444992ffe9a64a96560af1147560803092069 (patch) | |
tree | 72b8206634e5d3d0514152c8116c45c345143ac5 /Misc | |
parent | 06fe7e5c2ce3d6483da52ada2583c8da3af16326 (diff) | |
download | cpython-3ff444992ffe9a64a96560af1147560803092069.zip cpython-3ff444992ffe9a64a96560af1147560803092069.tar.gz cpython-3ff444992ffe9a64a96560af1147560803092069.tar.bz2 |
(py-compute-indentation): in `t' clause, watch for the
re-search-backwards landing you inside a mult-line string.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/python-mode.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index de5a8cb..76b391c 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -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) |