aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax Lohrmann <dmoagx@users.noreply.github.com>2015-08-25 02:35:18 +0200
committerMax Lohrmann <dmoagx@users.noreply.github.com>2015-08-25 02:35:18 +0200
commit4552d5daa1bcb094ce2681e594fca69379a469d0 (patch)
treeb659a501f8aa0636513bb3cadf65e60e7654685f /Source
parent23e86b8987f6aca98abefbfe3a669ee1af3c6d50 (diff)
parent83322eaf2d9d5729485149d707bca9df7c6006b4 (diff)
downloadsequelpro-4552d5daa1bcb094ce2681e594fca69379a469d0.tar.gz
sequelpro-4552d5daa1bcb094ce2681e594fca69379a469d0.tar.bz2
sequelpro-4552d5daa1bcb094ce2681e594fca69379a469d0.zip
Merge pull request #2211 from nacho4d/feature/2156
Feature/2156
Diffstat (limited to 'Source')
-rw-r--r--Source/SPTextView.m18
1 files changed, 8 insertions, 10 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 12d6ed13..e37b5939 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -3203,18 +3203,16 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
-
- // Enable or disable the search in the MySQL help menu item depending on whether there is a
+ // Enable or disable the search in the MySQL help menu item depending on whether there is a
// selection and whether it is a reasonable length.
if ([menuItem action] == @selector(showMySQLHelpForCurrentWord:)) {
- if ([self selectedRange].length > 0) {
- [menuItem setTitle:NSLocalizedString(@"MySQL Help for Selection", @"MySQL Help for Selection")];
- } else {
- [menuItem setTitle: NSLocalizedString(@"MySQL Help for Word", @"MySQL Help for Word")];
- }
-
+ if ([self selectedRange].length > 0) {
+ [menuItem setTitle:NSLocalizedString(@"MySQL Help for Selection", @"MySQL Help for Selection")];
+ } else {
+ [menuItem setTitle: NSLocalizedString(@"MySQL Help for Word", @"MySQL Help for Word")];
+ }
NSUInteger stringSize = [self getRangeForCurrentWord].length;
- return (stringSize || stringSize > 64);
+ return (0 < stringSize && stringSize < 65); // 1 ≤ stringSize ≤ 64
}
// Enable Copy as RTF if something is selected
if ([menuItem action] == @selector(copyAsRTF)) {
@@ -3231,7 +3229,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
return NO;
}
- return YES;
+ return [super validateMenuItem:menuItem];
}
/**