Skip to content

Refactor MacVim tests and add startup delayed full screen tests #1523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/MacVim/MMAppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
- (void)refreshAllResizeConstraints;
- (void)refreshAllTextViews;

- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate extraArgs:(NSArray *)args;
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate;

//
Expand Down
24 changes: 16 additions & 8 deletions src/MacVim/MMAppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1298,31 +1298,39 @@ - (BOOL)validateMenuItem:(NSMenuItem *)item
return YES;
}

/// Open a new Vim window, potentially taking from cached (if preload is used).
///
/// @param mode Determine whether to use clean mode or not. Preload will only
/// be used if using normal mode.
///
/// @param activate Activate the window after it's opened.
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate extraArgs:(NSArray *)extraArgs
{
if (activate)
[self activateWhenNextWindowOpens];

// A cached controller requires no loading times and results in the new
// window popping up instantaneously. If the cache is empty it may take
// 1-2 seconds to start a new Vim process.
MMVimController *vc = (mode == NewWindowNormal) ? [self takeVimControllerFromCache] : nil;
MMVimController *vc = (mode == NewWindowNormal && extraArgs == nil) ? [self takeVimControllerFromCache] : nil;
if (vc) {
[[vc backendProxy] acknowledgeConnection];
} else {
NSArray *args = (mode == NewWindowNormal) ? nil
: (mode == NewWindowClean ? @[@"--clean"]
: @[@"--clean", @"-u", @"NONE"]);
if (extraArgs != nil) {
args = [args arrayByAddingObjectsFromArray:extraArgs];
}
[self launchVimProcessWithArguments:args workingDirectory:nil];
}
}

/// Open a new Vim window, potentially taking from cached (if preload is used).
///
/// @param mode Determine whether to use clean mode or not. Preload will only
/// be used if using normal mode.
///
/// @param activate Activate the window after it's opened.
- (void)openNewWindow:(enum NewWindowMode)mode activate:(BOOL)activate
{
return [self openNewWindow:mode activate:activate extraArgs:nil];
}

- (IBAction)newWindow:(id)sender
{
ASLogDebug(@"Open new window");
Expand Down
Loading
Loading