Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #51 from adamvaughan/nerdtree-keybindings

add nerdtree keybindings
  • Loading branch information...
commit 3f4cc3c0d2035cce1a9f77ad306f978bd9564535 2 parents 9ebb49a + 2df15a1
@alloy authored
Showing with 24 additions and 2 deletions.
  1. +24 −2 src/MacVim/MMFileBrowserController.m
View
26 src/MacVim/MMFileBrowserController.m
@@ -300,6 +300,8 @@ - (BOOL) isFlipped {
@end
#define ENTER_KEY_CODE 36
+#define TAB_KEY_CODE 48
+#define ESCAPE_KEY_CODE 53
#define LEFT_KEY_CODE 123
#define RIGHT_KEY_CODE 124
#define DOWN_KEY_CODE 125
@@ -394,7 +396,9 @@ - (void)keyDown:(NSEvent *)event {
[self sendSelectionChangedNotification];
}
return;
- } else {
+ } else if (event.keyCode != TAB_KEY_CODE && event.keyCode != ESCAPE_KEY_CODE
+ && event.keyCode != LEFT_KEY_CODE && event.keyCode != RIGHT_KEY_CODE
+ && event.keyCode != DOWN_KEY_CODE && event.keyCode != UP_KEY_CODE) {
switch ([[event.characters uppercaseString] characterAtIndex:0]) {
case 'H':
LEFT_KEY_CHAR = [NSString stringWithFormat:@"%C", 0xf702];
@@ -412,9 +416,27 @@ - (void)keyDown:(NSEvent *)event {
UP_KEY_CHAR = [NSString stringWithFormat:@"%C", 0xf700];
event = [self keyEventWithEvent:event character:UP_KEY_CHAR code:UP_KEY_CODE];
break;
+ case 'T':
+ [(MMFileBrowserController *)[self delegate] openSelectedFilesInCurrentWindowWithLayout:MMLayoutTabs];
+ event = nil;
+ break;
+ case 'I':
+ [(MMFileBrowserController *)[self delegate] openSelectedFilesInCurrentWindowWithLayout:MMLayoutHorizontalSplit];
+ event = nil;
+ break;
+ case 'S':
+ [(MMFileBrowserController *)[self delegate] openSelectedFilesInCurrentWindowWithLayout:MMLayoutVerticalSplit];
+ event = nil;
+ break;
+ default:
+ event = nil;
+ break;
}
}
- [super keyDown:event];
+
+ if (event != nil) {
+ [super keyDown:event];
+ }
}
- (NSMenu *)menuForEvent:(NSEvent *)event {
Please sign in to comment.
Something went wrong with that request. Please try again.