TextMate is a graphical text editor for OS X 10.7+
Revision | 64ff8a53e751cddf9197009ebf7e9aa26d778f80 (tree) |
---|---|
Zeit | 2012-08-18 22:30:24 |
Autor | Allan Odgaard <git@abet...> |
Commiter | Allan Odgaard |
Go to SCM Status is now a toggle
This is implemented by invoking “go back” if already showing an SCM URL. If there is no history (unlikely) then we instead “go up (parent)” which should take us to the root of the repository.
@@ -831,12 +831,21 @@ static struct data_source_options_map_t { NSString* const name; NSUInteger flag; | ||
831 | 831 | |
832 | 832 | - (IBAction)goToSCMDataSource:(id)sender |
833 | 833 | { |
834 | - for(NSURL* selectedURL in self.selectedURLs) | |
834 | + if([url.scheme isEqualToString:@"scm"]) | |
835 | 835 | { |
836 | - if([selectedURL isFileURL] && path::is_directory([[selectedURL path] fileSystemRepresentation])) | |
837 | - return [self pushURL:[FSSCMDataSource scmURLWithPath:[selectedURL path]]]; | |
836 | + if(historyController.previousURL) | |
837 | + [self goBack:sender]; | |
838 | + else [self goToParentFolder:sender]; | |
839 | + } | |
840 | + else | |
841 | + { | |
842 | + for(NSURL* selectedURL in self.selectedURLs) | |
843 | + { | |
844 | + if([selectedURL isFileURL] && path::is_directory([[selectedURL path] fileSystemRepresentation])) | |
845 | + return [self pushURL:[FSSCMDataSource scmURLWithPath:[selectedURL path]]]; | |
846 | + } | |
847 | + [self pushURL:[FSSCMDataSource scmURLWithPath:[url path]]]; | |
838 | 848 | } |
839 | - [self pushURL:[FSSCMDataSource scmURLWithPath:[url path]]]; | |
840 | 849 | } |
841 | 850 | |
842 | 851 | - (IBAction)goBack:(id)sender { if(historyController.previousURL) { [self setURL:historyController.previousURL]; [historyController retreat:self]; [outlineViewDelegate scrollToOffset:historyController.currentURLScrollOffset]; [self updateView]; } } |