From b2e63fad01ca76b9090c1a0adbd999990d817846 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 28 Jul 2014 02:44:02 +0200 Subject: Fix a error that prevents building in Xcode6b4 --- Source/SPAppController.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/SPAppController.m b/Source/SPAppController.m index 79f4a745..44f3513d 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1183,14 +1183,14 @@ id firstResponder = [[NSApp keyWindow] firstResponder]; if([firstResponder respondsToSelector:@selector(executeBundleItemForInputField:)]) { - BOOL selfIsQueryEditor = ([[[firstResponder class] description] isEqualToString:@"SPTextView"]) ; + BOOL selfIsQueryEditor = ([[[firstResponder class] description] isEqualToString:@"SPTextView"] && [[firstResponder delegate] respondsToSelector:@selector(currentQueryRange)]); NSRange currentWordRange, currentSelectionRange, currentLineRange, currentQueryRange; currentSelectionRange = [firstResponder selectedRange]; currentWordRange = [firstResponder getRangeForCurrentWord]; currentLineRange = [[firstResponder string] lineRangeForRange:NSMakeRange([firstResponder selectedRange].location, 0)]; if(selfIsQueryEditor) { - currentQueryRange = [[firstResponder delegate] currentQueryRange]; + currentQueryRange = [(SPCustomQuery *)[firstResponder delegate] currentQueryRange]; } else { currentQueryRange = currentLineRange; } @@ -1199,8 +1199,8 @@ [env setObject:SPBundleScopeInputField forKey:SPBundleShellVariableBundleScope]; - if(selfIsQueryEditor && [[firstResponder delegate] currentQueryRange].length) - [env setObject:[[firstResponder string] substringWithRange:[[firstResponder delegate] currentQueryRange]] forKey:SPBundleShellVariableCurrentQuery]; + if(selfIsQueryEditor && [(SPCustomQuery *)[firstResponder delegate] currentQueryRange].length) + [env setObject:[[firstResponder string] substringWithRange:[(SPCustomQuery *)[firstResponder delegate] currentQueryRange]] forKey:SPBundleShellVariableCurrentQuery]; if(currentSelectionRange.length) [env setObject:[[firstResponder string] substringWithRange:currentSelectionRange] forKey:SPBundleShellVariableSelectedText]; -- cgit v1.2.3