Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

After an item is collapsed, free memory of children. It's fast enough.

  • Loading branch information...
commit 79a90e933fbd7c18970bd173679cba22debae843 1 parent bf804fd
@alloy authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/MacVim/MMFileBrowserController.m
View
11 src/MacVim/MMFileBrowserController.m
@@ -150,7 +150,7 @@ - (NSString *)description;
//}
static void
-MMFileBrowserFSItemStackIncrease(NSArray *stack,
+MMFileBrowserFSItemStackIncrease(NSMutableArray *stack,
MMFileBrowserFSItem *newItem,
NSMutableArray **newChildren,
BOOL *checkChildrenForExistingItem)
@@ -477,8 +477,8 @@ - (void)mouseDown:(NSEvent *)event {
NSInteger row = [self rowAtPoint:[self convertPoint:event.locationInWindow fromView:nil]];
MMFileBrowserFSItem *item = [self itemAtRow:row];
+ // TODO check if this can be done from the ‘will expand’ delegate method
if (![item isLeaf] && ![self isItemExpanded:item]) {
- // We load directory contents, recursive or not recursive, just-in-time.
if (event.modifierFlags & NSAlternateKeyMask) {
// Recursive to any depth.
[item loadChildrenRecursive:YES expandedChildrenOnly:NO];
@@ -1133,6 +1133,13 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView
}
}
+- (void)outlineViewItemDidCollapse:(NSNotification *)notification;
+{
+ MMFileBrowserFSItem *item = [notification.userInfo objectForKey:@"NSObject"];
+ // Free memory
+ item.children = nil;
+}
+
// Actions
// =======
Please sign in to comment.
Something went wrong with that request. Please try again.