aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-09-15 00:05:33 +0000
committerrowanbeentje <rowan@beent.je>2009-09-15 00:05:33 +0000
commit1c936a29bdd7da08e61603caec2f20aeed119135 (patch)
treebf232f8e1ce7bbf034938f66d3b9238a4b450c5a /Source/CustomQuery.m
parentaf045e33aae9756464e42dc51ea1f4b8cea91097 (diff)
downloadsequelpro-1c936a29bdd7da08e61603caec2f20aeed119135.tar.gz
sequelpro-1c936a29bdd7da08e61603caec2f20aeed119135.tar.bz2
sequelpro-1c936a29bdd7da08e61603caec2f20aeed119135.zip
Improve .sql file loading into the query editor:
- Allow undo of the insertion - Update scrollbar size/position after the update - Ensure the cursor is scrolled to
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 0a2958ee..f393dc45 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1107,13 +1107,18 @@
*/
- (void)doPerformQueryService:(NSString *)query
{
+ [textView shouldChangeTextInRange:NSMakeRange(0, [[textView string] length]) replacementString:query];
[textView setString:query];
+ [textView didChangeText];
+ [textView scrollRangeToVisible:NSMakeRange([query length], 0)];
[self runAllQueries:self];
}
- (void)doPerformLoadQueryService:(NSString *)query
{
+ [textView shouldChangeTextInRange:NSMakeRange(0, [[textView string] length]) replacementString:query];
[textView setString:query];
- // [textView insertText:@""];
+ [textView didChangeText];
+ [textView scrollRangeToVisible:NSMakeRange([query length], 0)];
}
- (NSString *)usedQuery