diff --git a/Frameworks/OakFileBrowser/src/io/FSSCMDataSource.mm b/Frameworks/OakFileBrowser/src/io/FSSCMDataSource.mm index ddc94fdf..a6b656a3 100644 --- a/Frameworks/OakFileBrowser/src/io/FSSCMDataSource.mm +++ b/Frameworks/OakFileBrowser/src/io/FSSCMDataSource.mm @@ -22,14 +22,18 @@ static NSURL* URLAppend (NSURL* base, NSString* relativePath) static NSArray* convert (std::vector const& paths, std::string const& wcPath, NSUInteger options, bool hideSCMBadge = false) { + auto parents = path::disambiguate(paths); + auto parent = parents.begin(); + NSMutableArray* res = [NSMutableArray array]; for(auto const& path : paths) { - FSItem* item = [FSItem itemWithURL:[NSURL fileURLWithPath:[NSString stringWithCxxString:path]]]; - item.target = [NSURL fileURLWithPath:[NSString stringWithCxxString:path]]; - item.labelIndex = path::label_index(path); - item.toolTip = [NSString stringWithCxxString:path::relative_to(path, wcPath)]; - item.leaf = YES; + FSItem* item = [FSItem itemWithURL:[NSURL fileURLWithPath:[NSString stringWithCxxString:path]]]; + item.displayName = [NSString stringWithCxxString:path::display_name(path, *parent++)]; + item.target = [NSURL fileURLWithPath:[NSString stringWithCxxString:path]]; + item.labelIndex = path::label_index(path); + item.toolTip = [NSString stringWithCxxString:path::relative_to(path, wcPath)]; + item.leaf = YES; if(hideSCMBadge) item.icon.scmStatus = scm::status::none;