diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2002-07-21 01:24:28 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2002-07-21 01:24:28 (GMT) |
commit | 1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50 (patch) | |
tree | 0c19bb30a4355723cac2a1e5b2f0e28a0ec0d380 /Lib/idlelib | |
parent | d69030db4ff101c6182ef13d8a057f5b8d5193d6 (diff) | |
download | cpython-1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50.zip cpython-1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50.tar.gz cpython-1bf4c2d2c9cc70f9b3de8a8b54dde20e5939bd50.tar.bz2 |
Bug: clearing the shell undo list after a prompt was allowing files to be
opened on top of the shell instead of in a new window.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/IOBinding.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index eb901dc..496bc43 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -87,17 +87,23 @@ class IOBinding: else: filename=editFile if filename: - # if the current window has no filename and hasn't been - # modified, we replace it's contents (no loss). Otherwise - # we open a new window. - if not self.filename and self.get_saved(): + # If the current window has no filename and hasn't been + # modified, we replace its contents (no loss). Otherwise + # we open a new window. But we won't replace the + # shell window (which has an interp(reter) attribute), which + # gets set to "not modified" at every new prompt. + try: + interp = self.editwin.interp + except: + interp = None + if not self.filename and self.get_saved() and not interp: self.editwin.flist.open(filename, self.loadfile) else: self.editwin.flist.open(filename) else: self.text.focus_set() - return "break" + # # Code for use outside IDLE: if self.get_saved(): reply = self.maybesave() |