summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-04-01 21:59:41 (GMT)
committerBarry Warsaw <barry@python.org>1998-04-01 21:59:41 (GMT)
commit92166d9a75ce034ae86cff746207e401e5065976 (patch)
treec5c460db5c42b25f8f370ee6709a77f79c3fbdfb /Misc
parent585f733b395df42d75d286f2f5911cef35bb835b (diff)
downloadcpython-92166d9a75ce034ae86cff746207e401e5065976.zip
cpython-92166d9a75ce034ae86cff746207e401e5065976.tar.gz
cpython-92166d9a75ce034ae86cff746207e401e5065976.tar.bz2
(py-compute-indentation): When looking at a continuation line inside
an open paren, do a better job of reindenting the line. For example: def foo(): print 'hello %s, %d' % ( a, b) Hit TAB on the line starting with `a'. Without this patch this line will never be reindented.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/python-mode.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 6fadfa1..b50ce95 100644
--- a/Misc/python-mode.el
+++ b/Misc/python-mode.el
@@ -1529,7 +1529,12 @@ the new line indented."
(while (and (< (point) startpos)
(looking-at "[ \t]*[#\n\\\\]")) ; skip noise
(forward-line 1))
- (if (< (point) startpos)
+ (if (and (< (point) startpos)
+ (/= startpos
+ (save-excursion
+ (goto-char (1+ open-bracket-pos))
+ (skip-chars-forward " \t\n")
+ (point))))
;; again mimic the first list item
(current-indentation)
;; else they're about to enter the first item