mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF 748973 Guido van Rossum patch
New Window should save in the directory of the Editor Window from which it was selected. M EditorWindow.py M FileList.py M IOBinding.py
This commit is contained in:
parent
a1045567e0
commit
d2f4861a0b
3 changed files with 21 additions and 8 deletions
|
@ -179,12 +179,18 @@ class IOBinding:
|
|||
self.filename_change_hook = hook
|
||||
|
||||
filename = None
|
||||
dirname = None
|
||||
|
||||
def set_filename(self, filename):
|
||||
self.filename = filename
|
||||
self.set_saved(1)
|
||||
if self.filename_change_hook:
|
||||
self.filename_change_hook()
|
||||
if filename and os.path.isdir(filename):
|
||||
self.filename = None
|
||||
self.dirname = filename
|
||||
else:
|
||||
self.filename = filename
|
||||
self.dirname = None
|
||||
self.set_saved(1)
|
||||
if self.filename_change_hook:
|
||||
self.filename_change_hook()
|
||||
|
||||
def open(self, event=None, editFile=None):
|
||||
if self.editwin.flist:
|
||||
|
@ -505,6 +511,8 @@ class IOBinding:
|
|||
def defaultfilename(self, mode="open"):
|
||||
if self.filename:
|
||||
return os.path.split(self.filename)
|
||||
elif self.dirname:
|
||||
return self.dirname, ""
|
||||
else:
|
||||
try:
|
||||
pwd = os.getcwd()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue