mirror of
https://github.com/textmate/textmate.git
synced 2026-01-22 13:17:55 -05:00
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.
This commit is contained in:
@@ -831,12 +831,21 @@ static struct data_source_options_map_t { NSString* const name; NSUInteger flag;
|
||||
|
||||
- (IBAction)goToSCMDataSource:(id)sender
|
||||
{
|
||||
for(NSURL* selectedURL in self.selectedURLs)
|
||||
if([url.scheme isEqualToString:@"scm"])
|
||||
{
|
||||
if([selectedURL isFileURL] && path::is_directory([[selectedURL path] fileSystemRepresentation]))
|
||||
return [self pushURL:[FSSCMDataSource scmURLWithPath:[selectedURL path]]];
|
||||
if(historyController.previousURL)
|
||||
[self goBack:sender];
|
||||
else [self goToParentFolder:sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
for(NSURL* selectedURL in self.selectedURLs)
|
||||
{
|
||||
if([selectedURL isFileURL] && path::is_directory([[selectedURL path] fileSystemRepresentation]))
|
||||
return [self pushURL:[FSSCMDataSource scmURLWithPath:[selectedURL path]]];
|
||||
}
|
||||
[self pushURL:[FSSCMDataSource scmURLWithPath:[url path]]];
|
||||
}
|
||||
[self pushURL:[FSSCMDataSource scmURLWithPath:[url path]]];
|
||||
}
|
||||
|
||||
- (IBAction)goBack:(id)sender { if(historyController.previousURL) { [self setURL:historyController.previousURL]; [historyController retreat:self]; [outlineViewDelegate scrollToOffset:historyController.currentURLScrollOffset]; [self updateView]; } }
|
||||
|
||||
Reference in New Issue
Block a user