From 31634f3f531bbd6fdbf87eeda38a7c489cc539c1 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Sat, 15 Aug 2015 10:21:25 -0700 Subject: [PATCH 1/6] Add disableInitialEmptyEditor setting --- src/atom.coffee | 1 + src/config-schema.coffee | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/atom.coffee b/src/atom.coffee index 7065a0d93..3bba8ffca 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -673,6 +673,7 @@ class Atom extends Model @windowEventHandler?.unsubscribe() openInitialEmptyEditorIfNecessary: -> + return if @config.get('core.disableInitialEmptyEditor') if @getLoadSettings().initialPaths?.length is 0 and @workspace.getPaneItems().length is 0 @workspace.open(null) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index a1bd91cc7..2487f4c37 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -89,6 +89,10 @@ module.exports = 'windows1258', 'windows866' ] + disableInitialEmptyEditor: + description: 'Disable the initial empty editor when atom starts.' + type: 'boolean' + default: false editor: type: 'object' From c292299516747bd4953c48ea68f8af4c5024bbba Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Sun, 23 Aug 2015 07:51:22 -0700 Subject: [PATCH 2/6] Changed setting disableInitialEmptyEditor to openEmptyEditorOnStart --- src/atom.coffee | 2 +- src/config-schema.coffee | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/atom.coffee b/src/atom.coffee index 3bba8ffca..297e0ce31 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -673,7 +673,7 @@ class Atom extends Model @windowEventHandler?.unsubscribe() openInitialEmptyEditorIfNecessary: -> - return if @config.get('core.disableInitialEmptyEditor') + return unless @config.get('core.openEmptyEditorOnStart') if @getLoadSettings().initialPaths?.length is 0 and @workspace.getPaneItems().length is 0 @workspace.open(null) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index 2487f4c37..d8eeb6fe3 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -89,10 +89,10 @@ module.exports = 'windows1258', 'windows866' ] - disableInitialEmptyEditor: - description: 'Disable the initial empty editor when atom starts.' + openEmptyEditorOnStart: + description: 'Automatically opens an empty editor when atom starts.' type: 'boolean' - default: false + default: true editor: type: 'object' From 86dfb50becf41a64809b730318109f2e83614832 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Sun, 23 Aug 2015 08:07:19 -0700 Subject: [PATCH 3/6] Added spec for openEmptyEditorOnStart --- .../fixtures/atom-home/config-openEmptyEditorOnStart.cson | 6 ++++++ spec/integration/startup-spec.coffee | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson diff --git a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson new file mode 100644 index 000000000..4d09f3deb --- /dev/null +++ b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson @@ -0,0 +1,6 @@ +"*": + welcome: + showOnStartup: false + "exception-reporting": + userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" + openEmptyEditorOnStart: false \ No newline at end of file diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index d2583ed27..67f4dc0a8 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -196,6 +196,13 @@ describe "Starting Atom", -> , 5000) .waitForExist("atom-workspace") .waitForPaneItemCount(1, 5000) + + it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> + fs.writeFileSync(path.join(atomHome, 'config.cson'), fs.readFileSync(path.join(__dirname, 'fixtures', 'atom-home', 'config-openEmptyEditorOnStart.cson'))) + runAtom [], {ATOM_HOME: atomHome}, (client) -> + client + .waitForExist("atom-workspace") + .waitForPaneItemCount(0, 5000) it "reopens any previously opened windows", -> runAtom [tempDirPath], {ATOM_HOME: atomHome}, (client) -> From e5d78860974c067ee5a4ef934ff5b9263f4c9369 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Sun, 23 Aug 2015 08:09:09 -0700 Subject: [PATCH 4/6] Fix openEmptyEditorOnStart spec styling --- .../fixtures/atom-home/config-openEmptyEditorOnStart.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson index 4d09f3deb..cf86d6120 100644 --- a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson +++ b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson @@ -3,4 +3,4 @@ showOnStartup: false "exception-reporting": userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" - openEmptyEditorOnStart: false \ No newline at end of file + openEmptyEditorOnStart: false From effd96f4bb692aa5551e315c5b548bdc27bdfb18 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Mon, 24 Aug 2015 10:31:37 -0700 Subject: [PATCH 5/6] Fix openEmptyEditorOnStart fixture --- .../fixtures/atom-home/config-openEmptyEditorOnStart.cson | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson index cf86d6120..23ac98d08 100644 --- a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson +++ b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson @@ -3,4 +3,5 @@ showOnStartup: false "exception-reporting": userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" - openEmptyEditorOnStart: false + core: + openEmptyEditorOnStart: false From 82a80cd732018de87e09df2e3b4897355e324f53 Mon Sep 17 00:00:00 2001 From: Jonathan Delgado Date: Mon, 24 Aug 2015 10:32:56 -0700 Subject: [PATCH 6/6] Fixed openEmptyEditorOnStart fixture tabs --- .../fixtures/atom-home/config-openEmptyEditorOnStart.cson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson index 23ac98d08..84ea0be11 100644 --- a/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson +++ b/spec/integration/fixtures/atom-home/config-openEmptyEditorOnStart.cson @@ -3,5 +3,5 @@ showOnStartup: false "exception-reporting": userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" - core: + core: openEmptyEditorOnStart: false