aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-01-14 10:16:04 +0000
committerBibiko <bibiko@eva.mpg.de>2011-01-14 10:16:04 +0000
commite4afc0cda57f53dbbb5020a88d85777385cbc941 (patch)
tree8ce697f1acd9f43f3fd98beb35dfc6aa2df7b690 /Source/SPCustomQuery.m
parenteec292b2a6a348f061630bebc5bfd7d39aa57ea0 (diff)
downloadsequelpro-e4afc0cda57f53dbbb5020a88d85777385cbc941.tar.gz
sequelpro-e4afc0cda57f53dbbb5020a88d85777385cbc941.tar.bz2
sequelpro-e4afc0cda57f53dbbb5020a88d85777385cbc941.zip
• fixed issue to highlight the correct current query after undoing, i.e. do not using the cache
• added SP_SELECTED_TEXT_RANGE shell variable for Bundle support of scope Input Text • added 'insertText', 'setText', 'setSelectedTextRange' JavaScript functions to window.system bridge
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m6
1 files changed, 5 insertions, 1 deletions
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)