Commit 1bf4c2d2 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

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.
parent d69030db
...@@ -87,17 +87,23 @@ class IOBinding: ...@@ -87,17 +87,23 @@ class IOBinding:
else: else:
filename=editFile filename=editFile
if filename: if filename:
# if the current window has no filename and hasn't been # If the current window has no filename and hasn't been
# modified, we replace it's contents (no loss). Otherwise # modified, we replace its contents (no loss). Otherwise
# we open a new window. # we open a new window. But we won't replace the
if not self.filename and self.get_saved(): # 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) self.editwin.flist.open(filename, self.loadfile)
else: else:
self.editwin.flist.open(filename) self.editwin.flist.open(filename)
else: else:
self.text.focus_set() self.text.focus_set()
return "break" return "break"
#
# Code for use outside IDLE: # Code for use outside IDLE:
if self.get_saved(): if self.get_saved():
reply = self.maybesave() reply = self.maybesave()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment