aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-31 22:33:42 +0000
committerrowanbeentje <rowan@beent.je>2012-05-31 22:33:42 +0000
commit74605c185982d0f1882b8acbdd2d1703aadc1c40 (patch)
tree971c225144e0b94d87de6f1bee095fa651ac0bf2 /Source/SPCustomQuery.m
parent8e22ba45ee2376ebc050332e04081693d60968bc (diff)
downloadsequelpro-74605c185982d0f1882b8acbdd2d1703aadc1c40.tar.gz
sequelpro-74605c185982d0f1882b8acbdd2d1703aadc1c40.tar.bz2
sequelpro-74605c185982d0f1882b8acbdd2d1703aadc1c40.zip
- Fix some text reselection logic when running all queries, which appears to be legacy code from r600 (!) when the queries were run in a non-threaded manner. This addresses Issue #1337.
Diffstat (limited to 'Source/SPCustomQuery.m')
-rw-r--r--Source/SPCustomQuery.m35
1 files changed, 1 insertions, 34 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m
index f0edf945..4d61461f 100644
--- a/Source/SPCustomQuery.m
+++ b/Source/SPCustomQuery.m
@@ -115,40 +115,13 @@
[queryParser release];
- oldThreadedQueryRange = [textView selectedRange];
-
- // Unselect a selection if given to avoid interfering with error highlighting
- [textView setSelectedRange:NSMakeRange(oldThreadedQueryRange.location, 0)];
-
// Reset queryStartPosition
queryStartPosition = 0;
reloadingExistingResult = NO;
[self clearResultViewDetailsToRestore];
- // Remember query start position for error highlighting
- queryTextViewStartPosition = 0;
-
- [self performQueries:queries withCallback:@selector(runAllQueriesCallback)];
-}
-
-- (void)runAllQueriesCallback
-{
- // If no error was selected, reconstruct a given selection. This
- // may no longer be valid if the query text has changed in the
- // meantime, so error-checking is required.
- if (oldThreadedQueryRange.location + oldThreadedQueryRange.length <= [[textView string] length]) {
-
- if ([textView selectedRange].length == 0)
- [textView setSelectedRange:oldThreadedQueryRange];
-
- // Invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase
- NSRange oldRange = [textView selectedRange];
- [textView setSelectedRange:NSMakeRange(oldThreadedQueryRange.location,0)];
- [textView insertText:@""];
- [textView setSelectedRange:oldRange];
- [textView scrollRangeToVisible:oldRange];
- }
+ [self performQueries:queries withCallback:NULL];
}
/*
@@ -182,9 +155,6 @@
}
queries = [NSArray arrayWithObject:[SPSQLParser normaliseQueryForExecution:query]];
- // Remember query start position for error highlighting
- queryTextViewStartPosition = currentQueryRange.location;
-
// Otherwise, run the selected text.
} else {
queryParser = [[SPSQLParser alloc] initWithString:[[textView string] substringWithRange:selectedRange]];
@@ -201,9 +171,6 @@
}
[queryParser release];
-
- // Remember query start position for error highlighting
- queryTextViewStartPosition = selectedRange.location;
}
// Invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase