From 4b02310939bc9fea04b238ee0b7ca0c1b99de29d Mon Sep 17 00:00:00 2001 From: Rafael Laverde Date: Mon, 23 Jan 2017 11:04:26 -0500 Subject: [PATCH] Editor: Allow new files to be saved before modifing them. --- spyder/widgets/editor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py index dbc30eed3e1..9fde1f6fe5e 100644 --- a/spyder/widgets/editor.py +++ b/spyder/widgets/editor.py @@ -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