Browse files

Open the contextual menu when seleting an item with ctrl+enter.

  • Loading branch information...
1 parent 3d8564b commit 3fcc52fa089f6a16b7e736f7cf98a7edbb1e04b5 @alloy committed Sep 26, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/MacVim/MMFileBrowserController.m
View
11 src/MacVim/MMFileBrowserController.m
@@ -380,7 +380,16 @@ - (void)sendSelectionChangedNotification {
- (void)keyDown:(NSEvent *)event {
if (event.keyCode == ENTER_KEY_CODE) {
- [self sendSelectionChangedNotification];
+ if (event.modifierFlags & NSControlKeyMask) {
+ NSMenu *menu = [(MMFileBrowserController *)[self delegate] menuForRow:self.selectedRow];
+ NSPoint location = [self rectOfRow:self.selectedRow].origin;
+ location.x -= menu.size.width;
+ [menu popUpMenuPositioningItem:[menu itemAtIndex:0]
+ atLocation:location
+ inView:self];
+ } else {
+ [self sendSelectionChangedNotification];
+ }
return;
} else {
switch ([[event.characters uppercaseString] characterAtIndex:0]) {

0 comments on commit 3fcc52f

Please sign in to comment.