aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-04 12:34:50 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-04 12:34:50 +0000
commit2c5453a01eae97bf03f16cfd088f2f069bb0594d (patch)
tree2f46278ea90be2b7e951af3f70ce9d41fe67e355 /Source/CustomQuery.m
parent7b7e81cfdda087a27836cb056a7b7f1fbabe1d50 (diff)
downloadsequelpro-2c5453a01eae97bf03f16cfd088f2f069bb0594d.tar.gz
sequelpro-2c5453a01eae97bf03f16cfd088f2f069bb0594d.tar.bz2
sequelpro-2c5453a01eae97bf03f16cfd088f2f069bb0594d.zip
• fixed undo behaviour of insertion of history/query favs
• improved text macro/query favs insertion logic
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 75bbb894..a891f35e 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -211,11 +211,14 @@
if([[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask))
replaceContent = !replaceContent;
- if(replaceContent)
+ if(replaceContent) {
[textView setSelectedRange:NSMakeRange(0,[[textView string] length])];
+ [textView breakUndoCoalescing];
+ [textView insertText:@""];
+ }
// The actual query strings have been already stored as tooltip
- [textView insertFavoriteAsSnippet:[[queryFavoritesButton selectedItem] toolTip] atRange:[textView selectedRange]];
+ [textView insertFavoriteAsSnippet:[[queryFavoritesButton selectedItem] toolTip] atRange:NSMakeRange([textView selectedRange].location, 0)];
}
}
@@ -231,7 +234,7 @@
if ([queryHistoryButton indexOfSelectedItem] > 6) {
BOOL replaceContent = [prefs boolForKey:SPQueryHistoryReplacesContent];
-
+ [textView breakUndoCoalescing];
if([[NSApp currentEvent] modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask))
replaceContent = !replaceContent;
if(replaceContent)