diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py index c56de2cf6c8..b5f9a2b2d5d 100644 --- a/spyder/plugins/editor.py +++ b/spyder/plugins/editor.py @@ -431,7 +431,7 @@ def __init__(self, parent, ignore_last_opened_files=False): header = shebang + [ '# -*- coding: utf-8 -*-', '"""', 'Created on %(date)s', '', - '@author: %(username)s', '"""', ''] + '@author: %(username)s', '"""', '', ''] encoding.write(os.linesep.join(header), self.TEMPLATE_PATH, 'utf-8') self.projects = None diff --git a/spyder/widgets/editor.py b/spyder/widgets/editor.py index 2f0aeddc92b..f239ecf54dc 100644 --- a/spyder/widgets/editor.py +++ b/spyder/widgets/editor.py @@ -2307,7 +2307,8 @@ def new(self, filename, encoding, text, default_content=False): finfo = self.create_new_editor(filename, encoding, text, set_current=False, new=True) finfo.editor.set_cursor_position('eof') - finfo.editor.insert_text(os.linesep) + if not default_content: + finfo.editor.insert_text(os.linesep) if default_content: finfo.default = True finfo.editor.document().setModified(False)