diff options
author | rowanbeentje <rowan@beent.je> | 2009-09-15 00:05:33 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-09-15 00:05:33 +0000 |
commit | 1c936a29bdd7da08e61603caec2f20aeed119135 (patch) | |
tree | bf232f8e1ce7bbf034938f66d3b9238a4b450c5a /Source/CustomQuery.m | |
parent | af045e33aae9756464e42dc51ea1f4b8cea91097 (diff) | |
download | sequelpro-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.m | 7 |
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 |