diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2002-12-16 02:07:11 +0000 |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2002-12-16 02:07:11 +0000 |
commit | 822a77fcc761b3c9992950ddf48b3f0bec917b4d (patch) | |
tree | 39e69cbc0b8010183aedc7505ef0691a1d6f749d /Lib/idlelib/PyShell.py | |
parent | 8e5b53b3d9b1955494f5bfea638417f690808e05 (diff) | |
download | cpython-git-822a77fcc761b3c9992950ddf48b3f0bec917b4d.tar.gz |
M EditorWindow.py
M PyShell.py
Idlefork SF Bug 440383 - IDLE goes into beep loop
Fix loop in EditorWindow.newline_and_indent_event() and
in addition fix submission of >>> prompt to PyParse.Parser
Eliminate extra attribute EditorWindow.auto_indent
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r-- | Lib/idlelib/PyShell.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index f6e85f7428..52d1a7016e 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -886,7 +886,7 @@ class PyShell(OutputWindow): self.text.insert("insert", "\n") self.text.see("insert") else: - self.auto_indent(event) + self.newline_and_indent_event(event) return "break" def enter_callback(self, event): @@ -918,6 +918,11 @@ class PyShell(OutputWindow): # No stdin mark -- just get the current line self.recall(self.text.get("insert linestart", "insert lineend")) return "break" + # If we're between the beginning of the line and the iomark, i.e. + # in the prompt area, complain. + if self.text.compare("insert", "<", "iomark"): + self.text.bell() + return "break" # If we're in the current input and there's only whitespace # beyond the cursor, erase that whitespace first s = self.text.get("insert", "end-1c") @@ -926,7 +931,7 @@ class PyShell(OutputWindow): # If we're in the current input before its last line, # insert a newline right at the insert point if self.text.compare("insert", "<", "end-1c linestart"): - self.auto_indent(event) + self.newline_and_indent_event(event) return "break" # We're in the last line; append a newline and submit it self.text.mark_set("insert", "end-1c") @@ -934,7 +939,7 @@ class PyShell(OutputWindow): self.text.insert("insert", "\n") self.text.see("insert") else: - self.auto_indent(event) + self.newline_and_indent_event(event) self.text.tag_add("stdin", "iomark", "end-1c") self.text.update_idletasks() if self.reading: |