mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Allow inline expansion of symbolic links (in file browser)
This is enabled by running: defaults write com.macromates.TextMate.preview allowExpandingLinks -bool YES
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
OAK_DEBUG_VAR(FileBrowser_DSDirectory);
|
||||
|
||||
static NSString* const kUserDefaultsAllowExpandingLinksKey = @"allowExpandingLinks";
|
||||
|
||||
@interface FSFileItem : FSItem
|
||||
@property (nonatomic) dev_t device;
|
||||
@property (nonatomic) ino_t inode;
|
||||
@@ -167,6 +169,8 @@ private:
|
||||
|
||||
static void async_reload (FSDirectoryDataSource* dataSource, FSItem* rootItem, scm::weak_info_ptr weakSCMInfo, bool reloadWasRequested)
|
||||
{
|
||||
BOOL allowExpandingLinks = [[[NSUserDefaults standardUserDefaults] objectForKey:kUserDefaultsAllowExpandingLinksKey] boolValue];
|
||||
|
||||
std::string const dir = to_s([rootItem.url path]);
|
||||
bool includeHidden = (dataSource.dataSourceOptions & kFSDataSourceOptionIncludeHidden) == kFSDataSourceOptionIncludeHidden;
|
||||
|
||||
@@ -243,6 +247,9 @@ private:
|
||||
item.leaf = !fsItem.treat_as_directory;
|
||||
item.target = fsItem.target != NULL_STR ? [NSURL URLWithString:[NSString stringWithCxxString:fsItem.target]] : nil;
|
||||
|
||||
if(allowExpandingLinks && fsItem.is_link && fsItem.sort_as_directory && item.leaf)
|
||||
item.leaf = NO;
|
||||
|
||||
[array addObject:item];
|
||||
pathsOnDisk.insert(fsItem.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user