summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/EditorWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/EditorWindow.py')
-rw-r--r--Lib/idlelib/EditorWindow.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index fcb1612..2303537 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -139,7 +139,7 @@ class EditorWindow:
flist.inversedict[self] = key
if key:
flist.dict[key] = self
- text.bind("<<open-new-window>>", self.flist.new_callback)
+ text.bind("<<open-new-window>>", self.new_callback)
text.bind("<<close-all-windows>>", self.flist.close_all_callback)
text.bind("<<open-class-browser>>", self.open_class_browser)
text.bind("<<open-path-browser>>", self.open_path_browser)
@@ -182,7 +182,7 @@ class EditorWindow:
self.UpdateRecentFilesList()
if filename:
- if os.path.exists(filename):
+ if os.path.exists(filename) and not os.path.isdir(filename):
io.loadfile(filename)
else:
io.set_filename(filename)
@@ -210,6 +210,11 @@ class EditorWindow:
self.extensions['AutoIndent'].set_indentation_params(
self.ispythonsource(filename))
+ def new_callback(self, event):
+ dirname, basename = self.io.defaultfilename()
+ self.flist.new(dirname)
+ return "break"
+
def set_status_bar(self):
self.status_bar = self.MultiStatusBar(self.top)
self.status_bar.set_label('column', 'Col: ?', side=RIGHT)