mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Selecting file outside project (⌃⌘R) would fail
This commit is contained in:
@@ -992,13 +992,26 @@ static bool is_binary (std::string const& path)
|
||||
NSMutableSet<NSURL*>* expandURLs = [self.fileBrowserView.expandedURLs mutableCopy];
|
||||
|
||||
NSURL* childURL = url;
|
||||
while([childURL getResourceValue:&childURL forKey:NSURLParentDirectoryURLKey error:nil] && ![childURL isEqual:parentURL])
|
||||
while(true)
|
||||
{
|
||||
NSNumber* flag;
|
||||
if([childURL getResourceValue:&flag forKey:NSURLIsVolumeKey error:nil] && [flag boolValue])
|
||||
break;
|
||||
|
||||
NSURL* potentialParentURL;
|
||||
if(![childURL getResourceValue:&potentialParentURL forKey:NSURLParentDirectoryURLKey error:nil] || [childURL isEqual:potentialParentURL])
|
||||
break;
|
||||
|
||||
childURL = potentialParentURL;
|
||||
if([childURL isEqual:currentParent])
|
||||
{
|
||||
parentURL = currentParent;
|
||||
break;
|
||||
}
|
||||
|
||||
if([childURL isEqual:parentURL])
|
||||
break;
|
||||
|
||||
[expandURLs addObject:childURL];
|
||||
}
|
||||
|
||||
@@ -1007,6 +1020,11 @@ static bool is_binary (std::string const& path)
|
||||
[self goToURL:parentURL];
|
||||
[self.fileBrowserView expandURLs:expandURLs.allObjects selectURLs:@[ url ]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self goToURL:url.URLByDeletingLastPathComponent];
|
||||
[self.fileBrowserView expandURLs:nil selectURLs:@[ url ]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)reload:(id)sender
|
||||
|
||||
Reference in New Issue
Block a user