Skip to content

Commit 655983b

Browse files
committed
Open Find / Replace dialog in the current space.
Set the window's collection behavior to include NSWindowCollectionBehaviorMoveToActiveSpace. This tells macOS to always show the Find dialog in the current active space (the one where you press Command+F) rather than following the application to another space. Resolves #1629
1 parent 78e8ec8 commit 655983b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/MacVim/MMFindReplaceController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ - (void)showWithText:(NSString *)text flags:(int)flags
3131
// Ensure that the window has been loaded by calling this first.
3232
NSWindow *window = [self window];
3333

34+
// Set collection behavior to ensure the dialog appears in the current
35+
// space rather than jumping to another space.
36+
NSWindowCollectionBehavior wcb = window.collectionBehavior;
37+
wcb |= NSWindowCollectionBehaviorMoveToActiveSpace;
38+
[window setCollectionBehavior:wcb];
39+
3440
if (text && [text length] > 0)
3541
[findBox setStringValue:text];
3642

0 commit comments

Comments
 (0)