Skip to content

Commit

Permalink
File->Open pops up a modal 'open files' dialog
Browse files Browse the repository at this point in the history
The File->Open dialog lets the user choose one or more files which are
opened in tabs in a new window; it replaces the behaviour where
File->Open presented a sheet which opened (at most) one file in the
topmost window.  This conforms better with the standard File->Open
behaviour of Mac apps.
  • Loading branch information
b4winckler committed Jan 23, 2008
1 parent 5bc6c46 commit 2d45730
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MacVim/Actions.plist
Expand Up @@ -6,6 +6,8 @@
<string></string>
<key>arrangeInFront:</key>
<string></string>
<key>fileOpen:</key>
<string></string>
<key>fontSizeDown:</key>
<string></string>
<key>fontSizeUp:</key>
Expand Down
1 change: 1 addition & 0 deletions src/MacVim/MMAppController.h
Expand Up @@ -26,6 +26,7 @@
- (void)removeVimController:(id)controller;
- (void)windowControllerWillOpen:(MMWindowController *)windowController;
- (IBAction)newWindow:(id)sender;
- (IBAction)fileOpen:(id)sender;
- (IBAction)selectNextWindow:(id)sender;
- (IBAction)selectPreviousWindow:(id)sender;
- (IBAction)fontSizeUp:(id)sender;
Expand Down
10 changes: 10 additions & 0 deletions src/MacVim/MMAppController.m
Expand Up @@ -429,6 +429,16 @@ - (IBAction)newWindow:(id)sender
[self launchVimProcessWithArguments:nil];
}

- (IBAction)fileOpen:(id)sender
{
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:YES];

int result = [panel runModalForTypes:nil];
if (NSOKButton == result)
[self application:NSApp openFiles:[panel filenames]];
}

- (IBAction)selectNextWindow:(id)sender
{
unsigned i, count = [vimControllers count];
Expand Down
2 changes: 2 additions & 0 deletions src/MacVim/gvimrc
Expand Up @@ -36,13 +36,15 @@ endif
" File menu

aunmenu File.New
aunmenu File.Open\.\.\.
aunmenu File.Close
aunmenu File.-SEP4-
aunmenu File.Exit
aunmenu File.Save-Exit

an <silent> 10.290 File.New\ Window :maca newWindow:<CR>
an 10.295 File.New\ Tab :tabnew<CR>
an <silent> 10.310 File.&Open\.\.\. :maca fileOpen:<CR>
an 10.328 File.-SEP0- <Nop>
an <silent> 10.330 File.Close\ Window<Tab>:qa :confirm qa<CR>
an 10.331 File.Close<Tab>:q :confirm q<CR>
Expand Down

0 comments on commit 2d45730

Please sign in to comment.