aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-07 13:05:09 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-07 13:05:09 +0000
commit7baf6b3c55d8a697bee72b846596ff371dbea8ac (patch)
tree76863870e7ae981958836e5e1d395b67ca75815c /Source/CustomQuery.m
parent8a8d39240ed1486c2fb4669f5f5340936c0ac391 (diff)
downloadsequelpro-7baf6b3c55d8a697bee72b846596ff371dbea8ac.tar.gz
sequelpro-7baf6b3c55d8a697bee72b846596ff371dbea8ac.tar.bz2
sequelpro-7baf6b3c55d8a697bee72b846596ff371dbea8ac.zip
• improved auto-uppercasing for: pasting queries from favourites & history and before performQueries
• improved undo behaviour of auto-uppercasing • added undo behaviour for pasting queries from favourites & history
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 23590fa7..39f961c6 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -56,6 +56,9 @@
[self performQueries:queries];
+ // Invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase
+ [textView insertText:@""];
+
// Select the text of the query textView for re-editing
[textView selectAll:self];
}
@@ -87,6 +90,12 @@
[queryParser release];
}
+ // Invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase
+ // and preserve the selection
+ [textView setSelectedRange:NSMakeRange(0,0)];
+ [textView insertText:@""];
+ [textView setSelectedRange:selectedRange];
+
[self performQueries:queries];
}
@@ -128,7 +137,11 @@ insert the choosen favorite query in the query textView or save query to favorit
[queryFavoritesSheet orderOut:nil];
} else if ( [queryFavoritesButton indexOfSelectedItem] != 3) {
//choose favorite
+ // Register the next action for undo
+ [textView shouldChangeTextInRange:[textView selectedRange] replacementString:[queryFavoritesButton titleOfSelectedItem]];
[textView replaceCharactersInRange:[textView selectedRange] withString:[queryFavoritesButton titleOfSelectedItem]];
+ // invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase
+ [textView insertText:@""];
}
}
@@ -137,7 +150,11 @@ insert the choosen favorite query in the query textView or save query to favorit
insert the choosen history query in the query textView
*/
{
+ // Register the next action for undo
+ [textView shouldChangeTextInRange:NSMakeRange(0,[[textView string] length]) replacementString:[queryHistoryButton titleOfSelectedItem]];
[textView setString:[queryHistoryButton titleOfSelectedItem]];
+ // Invoke textStorageDidProcessEditing: for syntax highlighting and auto-uppercase
+ [textView insertText:@""];
[textView selectAll:self];
}