File tree 5 files changed +25
-4
lines changed
5 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ + (void)initialize
234
234
[NSNumber numberWithBool: YES ], MMNativeFullScreenKey,
235
235
[NSNumber numberWithDouble: 0.25 ], MMFullScreenFadeTimeKey,
236
236
[NSNumber numberWithBool: NO ], MMUseCGLayerAlwaysKey,
237
+ [NSNumber numberWithBool: YES ], MMShareFindPboardKey,
237
238
nil ];
238
239
239
240
[[NSUserDefaults standardUserDefaults ] registerDefaults: dict];
Original file line number Diff line number Diff line change @@ -1544,10 +1544,14 @@ - (void)doFindNext:(BOOL)next
1544
1544
1545
1545
// See gui_macvim_add_to_find_pboard() for an explanation of these
1546
1546
// types.
1547
- if ([bestType isEqual: VimFindPboardType])
1547
+ if ([bestType isEqual: VimFindPboardType]) {
1548
1548
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
+ }
1551
1555
}
1552
1556
1553
1557
NSString *input = nil ;
Original file line number Diff line number Diff line change @@ -314,6 +314,9 @@ extern NSString *MMLogToStdErrKey;
314
314
// (techincally this is a user default but should not be used as such).
315
315
extern NSString *MMNoWindowKey;
316
316
317
+ // Argument used to control MacVim sharing search text via the Find Pasteboard.
318
+ extern NSString *MMShareFindPboardKey;
319
+
317
320
extern NSString *MMAutosaveRowsKey;
318
321
extern NSString *MMAutosaveColumnsKey;
319
322
extern NSString *MMRendererKey;
Original file line number Diff line number Diff line change 118
118
// (techincally this is a user default but should not be used as such).
119
119
NSString *MMNoWindowKey = @" MMNoWindow" ;
120
120
121
+ NSString *MMShareFindPboardKey = @" MMShareFindPboard" ;
122
+
121
123
NSString *MMAutosaveRowsKey = @" MMAutosaveRows" ;
122
124
NSString *MMAutosaveColumnsKey = @" MMAutosaveColumns" ;
123
125
NSString *MMRendererKey = @" MMRenderer" ;
Original file line number Diff line number Diff line change 36
36
static int MMMinFontSize = 6 ;
37
37
static int MMMaxFontSize = 100 ;
38
38
39
+ static BOOL MMShareFindPboard = YES ;
39
40
40
41
static GuiFont gui_macvim_font_with_name (char_u *name);
41
42
static int specialKeyToNSKey (int key);
198
199
// signs.
199
200
use_graphical_sign = (val == MMRendererCoreText);
200
201
}
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
+ }
201
211
}
202
212
203
213
1816
1826
// The second entry will be used by other applications when taking entries
1817
1827
// off the Find pasteboard, whereas MacVim will use the first if present.
1818
1828
[pb setString: s forType: VimFindPboardType];
1819
- [pb setString: [s stringByRemovingFindPatterns ] forType: NSStringPboardType ];
1829
+ if (MMShareFindPboard)
1830
+ [pb setString: [s stringByRemovingFindPatterns ] forType: NSStringPboardType ];
1820
1831
}
1821
1832
1822
1833
void
You can’t perform that action at this time.
0 commit comments