Improved the autoindent stuff

The autoindent should work now with multiple levels of indenting.
e.g.:
def foo():
	def bar():
		def baz():
			print "hi"
			print "ho"
This commit is contained in:
Bob Farrell
2008-04-28 16:34:23 +01:00
parent 72ac830f04
commit b7315c3928
+7 -2
View File
@@ -1003,11 +1003,16 @@ class Repl:
idiot)."""
self.ts = ''
indent = self.s.endswith(':') or self.s.startswith('\t')
n_indent = re.split( '[^\t]', self.s, 1 )[0].count('\t')
indent = self.s.endswith(':')
self.s = ''
self.iy, self.ix = self.scr.getyx()
if indent:#self.s_hist and self.s_hist[-1].rstrip().endswith(':'):
for i in range(n_indent):
self.c = '\t'
self.p_key()
if indent:
self.c = '\t'
self.p_key()