aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-04 17:42:04 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-04 17:42:04 +0000
commit6d3980063a2a37d7c3310a9808312b358ebdb2d3 (patch)
treedbcb6de00b028a4b6630f03ec403cfa9d28cd179 /Source/CustomQuery.m
parent4763ed6268a0c384cbd8ebbb8a324111cb7cc99d (diff)
downloadsequelpro-6d3980063a2a37d7c3310a9808312b358ebdb2d3.tar.gz
sequelpro-6d3980063a2a37d7c3310a9808312b358ebdb2d3.tar.bz2
sequelpro-6d3980063a2a37d7c3310a9808312b358ebdb2d3.zip
• fixed: suppress highlighting of the current query if something is selected
• added: "Select Active Query ^Y" context menu item to the Custom Query Editor
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index cbb9a38c..63a1efd4 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -818,6 +818,11 @@
return (queryRange.length) ? [[textView string] substringWithRange:queryRange] : nil;
}
+- (void)selectCurrentQuery
+{
+ if(currentQueryRange.length)
+ [textView setSelectedRange:currentQueryRange];
+}
#pragma mark -
#pragma mark Accessors
@@ -1245,7 +1250,8 @@
NSRange qRange = [self queryRangeAtPosition:caretPosition lookBehind:&isLookBehind];
// Highlight by setting a background color the current query
- if(qRange.length) {
+ // if nothing is selected
+ if(qRange.length && !currentSelection.length) {
[[textView textStorage] addAttribute: NSBackgroundColorAttributeName
value: [NSColor colorWithDeviceRed:0.95 green:0.95 blue:0.95 alpha:1]
range: qRange ];