Skip to content

Commit d8ebc8c

Browse files
daviwiljasonrudolph
authored andcommitted
Merge pull request atom#18855 from atom/dw-fix-open-folder
Fix "Open Folder" menu item on Windows
1 parent b701ed1 commit d8ebc8c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spec/main-process/atom-application.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ describe('AtomApplication', function () {
658658
atomApplication.promptForPathToOpen.reset()
659659

660660
atomApplication.emit('application:open-folder')
661-
await conditionPromise(() => atomApplication.promptForPathToOpen.calledWith('file'))
661+
await conditionPromise(() => atomApplication.promptForPathToOpen.calledWith('folder'))
662662
atomApplication.promptForPathToOpen.reset()
663663
})
664664
}

src/main-process/atom-application.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,6 @@ class AtomApplication extends EventEmitter {
382382
this.on('application:new-file', () => (this.focusedWindow() || this).openPath())
383383
this.on('application:open-dev', () => this.promptForPathToOpen('all', {devMode: true}))
384384
this.on('application:open-safe', () => this.promptForPathToOpen('all', {safeMode: true}))
385-
this.on('application:open', () => this.promptForPathToOpen('all', getLoadSettings(), getDefaultPath()))
386-
this.on('application:open-file', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath()))
387-
this.on('application:open-folder', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath()))
388385
this.on('application:inspect', ({x, y, atomWindow}) => {
389386
if (!atomWindow) atomWindow = this.focusedWindow()
390387
if (atomWindow) atomWindow.browserWindow.inspectElement(x, y)
@@ -406,6 +403,9 @@ class AtomApplication extends EventEmitter {
406403
this.on('application:check-for-update', () => this.autoUpdateManager.check())
407404

408405
if (process.platform === 'darwin') {
406+
this.on('application:open', () => this.promptForPathToOpen('all', getLoadSettings(), getDefaultPath()))
407+
this.on('application:open-file', () => this.promptForPathToOpen('file', getLoadSettings(), getDefaultPath()))
408+
this.on('application:open-folder', () => this.promptForPathToOpen('folder', getLoadSettings(), getDefaultPath()))
409409
this.on('application:bring-all-windows-to-front', () => Menu.sendActionToFirstResponder('arrangeInFront:'))
410410
this.on('application:hide', () => Menu.sendActionToFirstResponder('hide:'))
411411
this.on('application:hide-other-applications', () => Menu.sendActionToFirstResponder('hideOtherApplications:'))

0 commit comments

Comments
 (0)