Fix shell getMultilineCommand

Add limitation to avoid an infinite loop at EOF,
    when programmatically called on the current prompt.
This commit is contained in:
komoto
2022-04-26 22:30:49 +09:00
parent af8cca5189
commit ab6ec5b9fd

View File

@@ -946,7 +946,7 @@ class Shell(editwindow.EditWindow):
startpos = self.GetCurrentPos() + ps1size
line += 1
self.GotoLine(line)
while self.GetCurLine()[0][:ps2size] == ps2:
while self.GetCurLine()[0][:ps2size] == ps2 and line < self.LineCount:
line += 1
self.GotoLine(line)
stoppos = self.GetCurrentPos()