mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Convert to reference URL for file browser’s “Select Current Document”
This fixes problems with symbolic links, for example file browser may show contents of /private/tmp when we ask to select /tmp/foo.txt. Comparing file path URLs will fail even though /tmp is a symbolic link for /private/tmp. Note that this fix only works for when the current document is already part of the items in the file browser, as we still store pending URLs to select as file path URLs.
This commit is contained in:
@@ -1196,10 +1196,12 @@ static NSMutableIndexSet* MutableLongestCommonSubsequence (NSArray* lhs, NSArray
|
||||
|
||||
- (void)selectURL:(NSURL*)url withParentURL:(NSURL*)parentURL
|
||||
{
|
||||
url = url.fileReferenceURL;
|
||||
|
||||
for(NSInteger i = 0; i < self.outlineView.numberOfRows; ++i)
|
||||
{
|
||||
FileItem* item = [self.outlineView itemAtRow:i];
|
||||
if([url isEqual:item.URL])
|
||||
if([url isEqual:item.fileReferenceURL])
|
||||
{
|
||||
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
|
||||
[self centerSelectionInVisibleArea:self];
|
||||
|
||||
Reference in New Issue
Block a user