From f4189a6cfc9af1d109f6467c24ec4839c20f64d3 Mon Sep 17 00:00:00 2001 From: Guillermo Ignacio Enriquez Gutierrez Date: Tue, 25 Aug 2015 07:34:19 +0900 Subject: Call [super validateMenuItem:] on SPTextView to update osx build in menu items (issue #2156) --- Source/SPTextView.m | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'Source') diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 12d6ed13..f9ec441e 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -3203,16 +3203,14 @@ 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); } @@ -3231,7 +3229,7 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS return NO; } - return YES; + return [super validateMenuItem:menuItem]; } /** -- cgit v1.2.3