From bf3502c4db46c42e516eac0c18658aa5a3cd8ade Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 10 Feb 2019 13:50:32 -0800 Subject: [PATCH] Fix "Open Folder" menu item on Windows --- spec/main-process/atom-application.test.js | 2 +- src/main-process/atom-application.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/main-process/atom-application.test.js b/spec/main-process/atom-application.test.js index 65503b682..296ffcad9 100644 --- a/spec/main-process/atom-application.test.js +++ b/spec/main-process/atom-application.test.js @@ -658,7 +658,7 @@ describe('AtomApplication', function () { atomApplication.promptForPathToOpen.reset() atomApplication.emit('application:open-folder') - await conditionPromise(() => atomApplication.promptForPathToOpen.calledWith('file')) + await conditionPromise(() => atomApplication.promptForPathToOpen.calledWith('folder')) atomApplication.promptForPathToOpen.reset() }) } diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index 8edfdf39c..00fef2d6f 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -382,9 +382,6 @@ class AtomApplication extends EventEmitter { this.on('application:new-file', () => (this.focusedWindow() || this).openPath()) this.on('application:open-dev', () => this.promptForPathToOpen('all', {devMode: true})) this.on('application:open-safe', () => this.promptForPathToOpen('all', {safeMode: true})) - this.on('application:open', () => this.promptForPathToOpen('all', getLoadSettings(), getDefaultPath())) - this.on('application:open-file', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath())) - this.on('application:open-folder', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath())) this.on('application:inspect', ({x, y, atomWindow}) => { if (!atomWindow) atomWindow = this.focusedWindow() if (atomWindow) atomWindow.browserWindow.inspectElement(x, y) @@ -406,6 +403,9 @@ class AtomApplication extends EventEmitter { this.on('application:check-for-update', () => this.autoUpdateManager.check()) if (process.platform === 'darwin') { + this.on('application:open', () => this.promptForPathToOpen('all', getLoadSettings(), getDefaultPath())) + this.on('application:open-file', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath())) + this.on('application:open-folder', () => this.promptForPathToOpen('folder', getLoadSettings(), getDefaultPath())) this.on('application:bring-all-windows-to-front', () => Menu.sendActionToFirstResponder('arrangeInFront:')) this.on('application:hide', () => Menu.sendActionToFirstResponder('hide:')) this.on('application:hide-other-applications', () => Menu.sendActionToFirstResponder('hideOtherApplications:'))