[Idle-dev] CVS: idle EditorWindow.py,1.35,1.36 PyShell.py,1.38,1.39
Kurt B. Kaiser
kbk@users.sourceforge.net
Sun, 15 Dec 2002 18:07:13 -0800
Update of /cvsroot/idlefork/idle
In directory sc8-pr-cvs1:/tmp/cvs-serv30594
Modified Files:
EditorWindow.py PyShell.py
Log Message:
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
Index: EditorWindow.py
===================================================================
RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** EditorWindow.py 23 Oct 2002 04:48:08 -0000 1.35
--- EditorWindow.py 16 Dec 2002 02:07:11 -0000 1.36
***************
*** 1086,1091 ****
text.undo_block_stop()
- auto_indent = newline_and_indent_event
-
# Our editwin provides a is_char_in_string function that works
# with a Tk text index, but PyParse only knows about offsets into
--- 1086,1089 ----
Index: PyShell.py
===================================================================
RCS file: /cvsroot/idlefork/idle/PyShell.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** PyShell.py 14 Dec 2002 04:38:51 -0000 1.38
--- PyShell.py 16 Dec 2002 02:07:11 -0000 1.39
***************
*** 887,891 ****
self.text.see("insert")
else:
! self.auto_indent(event)
return "break"
--- 887,891 ----
self.text.see("insert")
else:
! self.newline_and_indent_event(event)
return "break"
***************
*** 919,922 ****
--- 919,927 ----
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
***************
*** 927,931 ****
# insert a newline right at the insert point
if self.text.compare("insert", "<", "end-1c linestart"):
! self.auto_indent(event)
return "break"
# We're in the last line; append a newline and submit it
--- 932,936 ----
# insert a newline right at the insert point
if self.text.compare("insert", "<", "end-1c linestart"):
! self.newline_and_indent_event(event)
return "break"
# We're in the last line; append a newline and submit it
***************
*** 935,939 ****
self.text.see("insert")
else:
! self.auto_indent(event)
self.text.tag_add("stdin", "iomark", "end-1c")
self.text.update_idletasks()
--- 940,944 ----
self.text.see("insert")
else:
! self.newline_and_indent_event(event)
self.text.tag_add("stdin", "iomark", "end-1c")
self.text.update_idletasks()