File tree Expand file tree Collapse file tree 5 files changed +25
-4
lines changed
Expand file tree Collapse file tree 5 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ + (void)initialize
234234 [NSNumber numberWithBool: YES ], MMNativeFullScreenKey,
235235 [NSNumber numberWithDouble: 0.25 ], MMFullScreenFadeTimeKey,
236236 [NSNumber numberWithBool: NO ], MMUseCGLayerAlwaysKey,
237+ [NSNumber numberWithBool: YES ], MMShareFindPboardKey,
237238 nil ];
238239
239240 [[NSUserDefaults standardUserDefaults ] registerDefaults: dict];
Original file line number Diff line number Diff line change @@ -1544,10 +1544,14 @@ - (void)doFindNext:(BOOL)next
15441544
15451545 // See gui_macvim_add_to_find_pboard() for an explanation of these
15461546 // types.
1547- if ([bestType isEqual: VimFindPboardType])
1547+ if ([bestType isEqual: VimFindPboardType]) {
15481548 query = [pb stringForType: VimFindPboardType];
1549- else
1550- query = [pb stringForType: NSStringPboardType ];
1549+ } else {
1550+ BOOL shareFindPboard = [[NSUserDefaults standardUserDefaults ]
1551+ boolForKey: MMShareFindPboardKey];
1552+ if (shareFindPboard)
1553+ query = [pb stringForType: NSStringPboardType ];
1554+ }
15511555 }
15521556
15531557 NSString *input = nil ;
Original file line number Diff line number Diff line change @@ -314,6 +314,9 @@ extern NSString *MMLogToStdErrKey;
314314// (techincally this is a user default but should not be used as such).
315315extern NSString *MMNoWindowKey;
316316
317+ // Argument used to control MacVim sharing search text via the Find Pasteboard.
318+ extern NSString *MMShareFindPboardKey;
319+
317320extern NSString *MMAutosaveRowsKey;
318321extern NSString *MMAutosaveColumnsKey;
319322extern NSString *MMRendererKey;
Original file line number Diff line number Diff line change 118118// (techincally this is a user default but should not be used as such).
119119NSString *MMNoWindowKey = @" MMNoWindow" ;
120120
121+ NSString *MMShareFindPboardKey = @" MMShareFindPboard" ;
122+
121123NSString *MMAutosaveRowsKey = @" MMAutosaveRows" ;
122124NSString *MMAutosaveColumnsKey = @" MMAutosaveColumns" ;
123125NSString *MMRendererKey = @" MMRenderer" ;
Original file line number Diff line number Diff line change 3636static int MMMinFontSize = 6 ;
3737static int MMMaxFontSize = 100 ;
3838
39+ static BOOL MMShareFindPboard = YES ;
3940
4041static GuiFont gui_macvim_font_with_name (char_u *name);
4142static int specialKeyToNSKey (int key);
198199 // signs.
199200 use_graphical_sign = (val == MMRendererCoreText);
200201 }
202+
203+ // Check to use the Find Pasteboard.
204+ MMShareFindPboard = CFPreferencesGetAppBooleanValue ((CFStringRef)MMShareFindPboardKey,
205+ kCFPreferencesCurrentApplication ,
206+ &keyValid);
207+ if (!keyValid) {
208+ // Share text via the Find Pasteboard by default.
209+ MMShareFindPboard = YES ;
210+ }
201211}
202212
203213
18161826 // The second entry will be used by other applications when taking entries
18171827 // off the Find pasteboard, whereas MacVim will use the first if present.
18181828 [pb setString: s forType: VimFindPboardType];
1819- [pb setString: [s stringByRemovingFindPatterns ] forType: NSStringPboardType ];
1829+ if (MMShareFindPboard)
1830+ [pb setString: [s stringByRemovingFindPatterns ] forType: NSStringPboardType ];
18201831}
18211832
18221833 void
You can’t perform that action at this time.
0 commit comments