aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextViewAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPTextViewAdditions.m')
-rw-r--r--Source/SPTextViewAdditions.m27
1 files changed, 22 insertions, 5 deletions
diff --git a/Source/SPTextViewAdditions.m b/Source/SPTextViewAdditions.m
index 381f8f0a..24a5236f 100644
--- a/Source/SPTextViewAdditions.m
+++ b/Source/SPTextViewAdditions.m
@@ -715,17 +715,19 @@
NSInteger i = 0;
for(NSDictionary *item in bundleItems) {
- NSString *keyEq = @"";
- // if([item objectForKey:SPBundleFileKeyEquivalentKey])
- // keyEq = [[item objectForKey:SPBundleFileKeyEquivalentKey] objectAtIndex:0];
- // else
- // keyEq = @"";
+ NSString *keyEq;
+ if([item objectForKey:SPBundleFileKeyEquivalentKey])
+ keyEq = [[item objectForKey:SPBundleFileKeyEquivalentKey] objectAtIndex:0];
+ else
+ keyEq = @"";
NSMenuItem *mItem = [[[NSMenuItem alloc] initWithTitle:[item objectForKey:SPBundleInternLabelKey] action:@selector(executeBundleItemForInputField:) keyEquivalent:keyEq] autorelease];
if([keyEq length])
[mItem setKeyEquivalentModifierMask:[[[item objectForKey:SPBundleFileKeyEquivalentKey] objectAtIndex:1] intValue]];
+ [mItem setTarget:[[NSApp mainWindow] firstResponder]];
+
if([item objectForKey:SPBundleFileTooltipKey])
[mItem setToolTip:[item objectForKey:SPBundleFileTooltipKey]];
@@ -744,6 +746,21 @@
}
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+
+ if([menuItem action] == @selector(executeBundleItemForEditor:))
+ {
+ return NO;
+ }
+ if([menuItem action] == @selector(executeBundleItemForInputField:))
+ {
+ return YES;
+ }
+
+ return YES;
+
+}
#pragma mark -
#pragma mark multi-touch trackpad support