aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2013-02-16 22:03:09 +0000
committerstuconnolly <stuart02@gmail.com>2013-02-16 22:03:09 +0000
commit27156550b646a74d2345b4ff9650b7a3b4ba052e (patch)
tree4f2608744fcef3524e1c208d860452a120e1a4ce /Source/SPTextView.m
parent624244dd35a6ca2e7942fbadbcaea756367b3453 (diff)
downloadsequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.tar.gz
sequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.tar.bz2
sequelpro-27156550b646a74d2345b4ff9650b7a3b4ba052e.zip
Fix more wanrings by creating a protocol that delegates of the copy table should conform to.
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 76a80774..fe013503 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -1790,15 +1790,16 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
currentDb = [tablesListInstance selectedDatabase];
#ifndef SP_CODA
- while([theHintString isMatchedByRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLES"]) {
+ while ([theHintString isMatchedByRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLES"])
+ {
r = [theHintString rangeOfRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLES"];
- if(r.length) {
- NSArray *selTables = [[[self delegate] valueForKeyPath:@"tablesListInstance"] selectedTableNames];
- if([selTables count])
- [theHintString replaceCharactersInRange:r withString:[selTables componentsJoinedAndBacktickQuoted]];
- else
- [theHintString replaceCharactersInRange:r withString:@"$SP_SELECTED_TABLE"];
+
+ if (r.length) {
+ NSArray *selTables = [[(NSObject *)[self delegate] valueForKeyPath:@"tablesListInstance"] selectedTableNames];
+
+ [theHintString replaceCharactersInRange:r withString:[selTables count] ? [selTables componentsJoinedAndBacktickQuoted] : @"$SP_SELECTED_TABLE"];
}
+
[theHintString flushCachedRegexData];
}
#endif