mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
File browser: Dispose all children on collapse
Previously we kept the children which had been expanded, as these had an associated record for tracking file system changes and SCM info. However, when expanding we weren’t actually re-using the item from the cached record, so not only was this wasteful, but it caused a problem because we effectively created a new item but used the old record with the old item, and while the two items would compare is equal when using isEqualTo:, they didn’t have the same memory address, so the outline view would not consider them equal, and would thus not react on reload requests when using the older item.
This commit is contained in:
@@ -330,7 +330,17 @@ private:
|
||||
if(visibleItems.find(to_s([anItem.url path])) == visibleItems.end())
|
||||
NSLog(@"%s %@, item not loaded", sel_getName(_cmd), anItem);
|
||||
|
||||
visibleItems.erase(to_s([anItem.url path]));
|
||||
NSMutableArray* children = [NSMutableArray arrayWithObject:anItem];
|
||||
for(NSUInteger i = 0; i < children.count; ++i)
|
||||
{
|
||||
for(FSItem* item in [children[i] children])
|
||||
{
|
||||
if(item.children)
|
||||
[children addObject:item];
|
||||
}
|
||||
}
|
||||
|
||||
[self lostItems:children];
|
||||
anItem.children = nil;
|
||||
return YES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user