-
Notifications
You must be signed in to change notification settings - Fork 619
APIs to open a folder with file pre-selected #244
Conversation
…ead of the folder within the parent. This commit keeps the current functionality for files, where the parent folder is opened and the file is selected.
too - opening the parent folder with that file already selected. (The Mac counterpart of this is already done in 1a3b149).
@redmunds for review |
This goes with pull adobe/brackets#2128 on the JS side, so you could sync to that branch to test this out. But you can also test it fairly easily by just invoking |
[[NSWorkspace sharedWorkspace] openFile:filepath]; | ||
} else { | ||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:[NSArray arrayWithObject: [NSURL fileURLWithPath: filepath]]]; | ||
} | ||
return NO_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return values from openFile
and activateFileViewerSelectingURLs
are ignored. Should they be propagated back to Brackets? At the very least we could write something to the console.
Same comment on the Windows side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activateFileViewerSelectingURLs
doesn't have a return value. openFile
does return YES
or NO
, but in my testing, the fileExistsAtPath
check above catches the only possible error.
Same thing on Windows with the GetFileAttributes()
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just opening File Explorer or Finder, so I guess there's not much we can do after verifying file or folder exists.
Done with review. |
Looks good. Merging. |
APIs to open a folder with file pre-selected
APIs to open a folder with file pre-selected
This will enable a nice "Show in Finder"/"Show in Explorer" command in Brackets core.