Fix "Open Folder" menu item on Windows

This commit is contained in:
David Wilson
2019-02-10 13:50:32 -08:00
parent 24ed380e78
commit bf3502c4db
2 changed files with 4 additions and 4 deletions

View File

@@ -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()
})
}

View File

@@ -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:'))