Skip to content

Commit

Permalink
Editor: Allow new files to be saved before modifing them.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaverde committed Jan 23, 2017
1 parent c907694 commit 4b02310
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spyder/widgets/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,8 @@ def save(self, index=None, force=False):
index = self.get_stack_index()

finfo = self.data[index]
if not finfo.editor.document().isModified() and not force:
if not (finfo.editor.document().isModified() or
finfo.newly_created) and not force:
return True
if not osp.isfile(finfo.filename) and not force:
# File has not been saved yet
Expand Down

0 comments on commit 4b02310

Please sign in to comment.