Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

We load dir contents just-in-time; load recursive or not depending on…

… ALT click.
  • Loading branch information...
commit e03e8d290c5a25649e7b366cca5c27b45fda2dc9 1 parent 5cbd247
@alloy authored
Showing with 13 additions and 9 deletions.
  1. +13 −9 src/MacVim/MMFileBrowserController.m
View
22 src/MacVim/MMFileBrowserController.m
@@ -474,20 +474,24 @@ - (void)cancelOperation:(id)sender {
- (void)mouseDown:(NSEvent *)event {
NSInteger before = self.selectedRow;
- if (event.modifierFlags & NSAlternateKeyMask) {
- NSInteger row = [self rowAtPoint:[self convertPoint:event.locationInWindow fromView:nil]];
- MMFileBrowserFSItem *item = [self itemAtRow:row];
- if (![item isLeaf] && ![self isItemExpanded:item]) {
- NSLog(@"EXPAND ALL, PRELOAD RECURSIVELY: %@", item);
+
+ NSInteger row = [self rowAtPoint:[self convertPoint:event.locationInWindow fromView:nil]];
+ MMFileBrowserFSItem *item = [self itemAtRow:row];
+
+ if (![item isLeaf] && ![self isItemExpanded:item]) {
+ // We load directory contents, recursive or not recursive, just-in-time.
+ if (event.modifierFlags & NSAlternateKeyMask) {
[item reloadRecursive:YES];
+ } else {
+ [item reloadRecursive:NO];
}
}
+
[super mouseDown:event];
+
// In case the item is not a directory and was already selected, then force
- // send the selection did change delegate messagges.
- if (event.clickCount == 1 &&
- self.selectedRow == before &&
- ![self isExpandable:[self itemAtRow:self.selectedRow]]) {
+ // send the ‘selection did change’ delegate messagges.
+ if (event.clickCount == 1 && self.selectedRow == before && [item isLeaf]) {
[self sendSelectionChangedNotification];
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.