Permalink
Browse files

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).
  • Loading branch information...
1 parent af55f6b commit cf1b4750e4e17d5ea653c4d20d6ed4b151a17fbd @sorbits sorbits committed Aug 17, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 Frameworks/DocumentWindow/src/DocumentController.mm
@@ -908,7 +908,10 @@ - (IBAction)revealFileInProject:(id)sender
{
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

0 comments on commit cf1b475

Please sign in to comment.