From e4afc0cda57f53dbbb5020a88d85777385cbc941 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 14 Jan 2011 10:16:04 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20to=20highlight=20the=20corr?= =?UTF-8?q?ect=20current=20query=20after=20undoing,=20i.e.=20do=20not=20us?= =?UTF-8?q?ing=20the=20cache=20=E2=80=A2=20added=20SP=5FSELECTED=5FTEXT=5F?= =?UTF-8?q?RANGE=20shell=20variable=20for=20Bundle=20support=20of=20scope?= =?UTF-8?q?=20Input=20Text=20=E2=80=A2=20added=20'insertText',=20'setText'?= =?UTF-8?q?,=20'setSelectedTextRange'=20JavaScript=20functions=20to=20=20w?= =?UTF-8?q?indow.system=20bridge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPCustomQuery.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/SPCustomQuery.m') diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index fa54790d..b2859010 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -45,6 +45,8 @@ @implementation SPCustomQuery +@synthesize textViewWasChanged; + #pragma mark IBAction methods /* @@ -940,7 +942,8 @@ // Split the current text into ranges of queries // only if the textView was really changed, otherwise use the cache - if([[textView textStorage] editedMask] != 0) { + if([[textView textStorage] editedMask] != 0 || [self textViewWasChanged]) { + [self setTextViewWasChanged:NO]; customQueryParser = [[SPSQLParser alloc] initWithString:[textView string]]; [customQueryParser setDelimiterSupport:YES]; queries = [[NSArray alloc] initWithArray:[customQueryParser splitStringIntoRangesByCharacter:';']]; @@ -2580,6 +2583,7 @@ BOOL isLookBehind = YES; NSRange currentSelection = [textView selectedRange]; NSUInteger caretPosition = currentSelection.location; + NSRange qRange = [self queryRangeAtPosition:caretPosition lookBehind:&isLookBehind]; if(qRange.length) -- cgit v1.2.3