diff --git a/src/MacVim/MMFindReplaceController.m b/src/MacVim/MMFindReplaceController.m index 9fef9421bb..1308f889aa 100644 --- a/src/MacVim/MMFindReplaceController.m +++ b/src/MacVim/MMFindReplaceController.m @@ -31,6 +31,14 @@ - (void)showWithText:(NSString *)text flags:(int)flags // Ensure that the window has been loaded by calling this first. NSWindow *window = [self window]; + // Set collection behavior to ensure the dialog appears in the current + // space rather than jumping to another space. + if (AVAILABLE_MAC_OS(10, 7)) { + NSWindowCollectionBehavior wcb = window.collectionBehavior; + wcb |= NSWindowCollectionBehaviorMoveToActiveSpace; + [window setCollectionBehavior:wcb]; + } + if (text && [text length] > 0) [findBox setStringValue:text];