##// END OF EJS Templates
_ip.runlines() handles cleanup of scripts that start new else blocks on indent level 0 correctly
Ville M. Vainio -
Show More
@@ -275,11 +275,12 b' class IPApi:'
275 lines = script.splitlines()
275 lines = script.splitlines()
276 level = 0
276 level = 0
277 for l in lines:
277 for l in lines:
278 stripped = l.lstrip()
278 lstripped = l.lstrip()
279 if not l.strip():
279 stripped = l.strip()
280 if not stripped:
280 continue
281 continue
281 newlevel = len(l) - len(stripped)
282 newlevel = len(l) - len(lstripped)
282 if level > 0 and newlevel == 0:
283 if level > 0 and newlevel == 0 and not stripped.endswith(':'):
283 # add empty line
284 # add empty line
284 res.append('')
285 res.append('')
285 res.append(l)
286 res.append(l)
General Comments 0
You need to be logged in to leave comments. Login now