Go to Current Document is now a toggle

This also works as a (quick) way to deselect all in the file browser (i.e. hit ⌃⌘R twice) which is useful when one wants to run commands on the entire project (e.g. Git → Show Uncommitted Changes).
This commit is contained in:
Allan Odgaard
2012-08-17 23:01:11 +02:00
parent af55f6b7bd
commit cf1b4750e4

View File

@@ -908,7 +908,10 @@ NSString* const kUserDefaultsFileBrowserPlacementKey = @"fileBrowserPlacement";
{
D(DBF_DocumentController, bug("%s\n", [self selectedDocument]->path().c_str()););
self.fileBrowserHidden = NO;
[fileBrowser showURL:[NSURL fileURLWithPath:[NSString stringWithCxxString:[self selectedDocument]->path()]]];
NSURL* currentDocumentURL = [NSURL fileURLWithPath:[NSString stringWithCxxString:[self selectedDocument]->path()]];
if([fileBrowser.selectedURLs count] == 1 && [currentDocumentURL isEqualTo:[fileBrowser.selectedURLs lastObject]])
[fileBrowser deselectAll:self];
else [fileBrowser showURL:currentDocumentURL];
}
- (IBAction)goToProjectFolder:(id)sender