diff Lib/idlelib/PyShell.py @ 35891:8fd46b660e66 legacy-trunk

Merge IDLE-syntax-branch r39668:41449 into trunk A idlelib/AutoCompleteWindow.py A idlelib/AutoComplete.py A idlelib/HyperParser.py M idlelib/PyShell.py M idlelib/ParenMatch.py M idlelib/configDialog.py M idlelib/EditorWindow.py M idlelib/PyParse.py M idlelib/CallTips.py M idlelib/CallTipWindow.py M idlelib/run.py M idlelib/config-extensions.def A idlelib/MultiCall.py
author Kurt B. Kaiser <kbk@shore.net>
date Fri, 18 Nov 2005 22:05:48 +0000
parents 0b7fa6f0552a
children 1b3b6b1982aa 081b4f0e81b7
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py	Fri Nov 18 16:51:05 2005 +0000
+++ b/Lib/idlelib/PyShell.py	Fri Nov 18 22:05:48 2005 +0000
@@ -1091,11 +1091,12 @@
                 self.recall(self.text.get(next[0], next[1]), event)
                 return "break"
             # No stdin mark -- just get the current line, less any prompt
-            line = self.text.get("insert linestart", "insert lineend")
-            last_line_of_prompt = sys.ps1.split('\n')[-1]
-            if line.startswith(last_line_of_prompt):
-                line = line[len(last_line_of_prompt):]
-            self.recall(line, event)
+            indices = self.text.tag_nextrange("console", "insert linestart")
+            if indices and \
+               self.text.compare(indices[0], "<=", "insert linestart"):
+                self.recall(self.text.get(indices[1], "insert lineend"), event)
+            else:
+                self.recall(self.text.get("insert linestart", "insert lineend"), event)
             return "break"
         # If we're between the beginning of the line and the iomark, i.e.
         # in the prompt area, move to the end of the prompt