diff options
-rw-r--r-- | Interfaces/English.lproj/MainMenu.xib | 6 | ||||
-rw-r--r-- | Source/SPTextView.h | 2 | ||||
-rw-r--r-- | Source/SPTextView.m | 13 |
3 files changed, 10 insertions, 11 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 990d38c6..d77e21c2 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -281,6 +281,12 @@ <action selector="selectCurrentLine:" target="-1" id="896"/> </connections> </menuItem> + <menuItem title="Active Query" keyEquivalent="y" id="kPp-CM-X9x"> + <modifierMask key="keyEquivalentModifierMask" control="YES"/> + <connections> + <action selector="selectCurrentQuery:" target="-1" id="ree-o4-Jbl"/> + </connections> + </menuItem> <menuItem title="Enclosing Brackets" keyEquivalent="B" id="932"> <connections> <action selector="selectEnclosingBrackets:" target="-1" id="933"/> diff --git a/Source/SPTextView.h b/Source/SPTextView.h index 4289bd40..31a39d7a 100644 --- a/Source/SPTextView.h +++ b/Source/SPTextView.h @@ -169,7 +169,7 @@ typedef struct { - (void) doAutoCompletion; - (void) refreshCompletion; - (NSArray *)suggestionsForSQLCompletionWith:(NSString *)currentWord dictMode:(BOOL)isDictMode browseMode:(BOOL)dbBrowseMode withTableName:(NSString*)aTableName withDbName:(NSString*)aDbName; -- (void) selectCurrentQuery; +- (IBAction) selectCurrentQuery:(id)sender; - (void) processMirroredSnippets; - (BOOL)checkForCaretInsideSnippet; diff --git a/Source/SPTextView.m b/Source/SPTextView.m index ce5f8454..36bd005e 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -1131,7 +1131,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } } -- (void) selectCurrentQuery +- (IBAction) selectCurrentQuery:(id)sender { if([self isEditable]) [customQueryInstance selectCurrentQuery]; @@ -2244,12 +2244,6 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS #endif } - if([charactersIgnMod isEqualToString:@"y"]) // ^Y select current query - if(curFlags==(NSControlKeyMask)) - { - [self selectCurrentQuery]; - return; - } if(curFlags & NSCommandKeyMask) { if([charactersIgnMod isEqualToString:@"+"] || [charactersIgnMod isEqualToString:@"="]) // increase text size by 1; ⌘+, ⌘=, and ⌘ numpad + { @@ -3112,9 +3106,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS } if ([[[self class] defaultMenu] itemWithTag:SP_CQ_SELECT_CURRENT_QUERY_MENU_ITEM_TAG] == nil) { - NSMenuItem *selectCurrentQueryMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Select Active Query", @"Select Active Query") action:@selector(selectCurrentQuery) keyEquivalent:@"y"]; + NSMenuItem *selectCurrentQueryMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Select Active Query", @"Select Active Query") action:@selector(selectCurrentQuery:) keyEquivalent:@""]; [selectCurrentQueryMenuItem setTag:SP_CQ_SELECT_CURRENT_QUERY_MENU_ITEM_TAG]; - [selectCurrentQueryMenuItem setKeyEquivalentModifierMask:NSControlKeyMask]; [menu insertItem:selectCurrentQueryMenuItem atIndex:4]; [selectCurrentQueryMenuItem release]; } @@ -3222,7 +3215,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS return ([self selectedRange].length>0); } // Validate Select Active Query - if ([menuItem action] == @selector(selectCurrentQuery)) { + if ([menuItem action] == @selector(selectCurrentQuery:)) { return ([self isEditable] && [[self delegate] isKindOfClass:[SPCustomQuery class]]); } // Disable "Copy with Column Names" and "Copy as SQL INSERT" |