Skip to content

Commit

Permalink
Merge pull request atom#18855 from atom/dw-fix-open-folder
Browse files Browse the repository at this point in the history
Fix "Open Folder" menu item on Windows
  • Loading branch information
daviwil authored and jasonrudolph committed Mar 12, 2019
1 parent b701ed1 commit d8ebc8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/main-process/atom-application.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/main-process/atom-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:'))
Expand Down

0 comments on commit d8ebc8c

Please sign in to comment.