aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-06 11:58:32 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-06 11:58:32 +0000
commit9f431c3e9faf9c1d6a66d192e5405203f65ca77c (patch)
treee961534dd88c67134c22a5c0c0ddfdd4696e94d3 /Source/CustomQuery.m
parentf6e926b95da15e963545805345d5afca3db0455e (diff)
downloadsequelpro-9f431c3e9faf9c1d6a66d192e5405203f65ca77c.tar.gz
sequelpro-9f431c3e9faf9c1d6a66d192e5405203f65ca77c.tar.bz2
sequelpro-9f431c3e9faf9c1d6a66d192e5405203f65ca77c.zip
• improved: sped up removing the background color for query highlighting
• added: DELIMITER to the completion suggestions
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 4d1d684d..26888225 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1267,9 +1267,15 @@
// Ensure that the notification is from the custom query text view
if ( [aNotification object] != textView ) return;
- // Remove all background color attributes for highlighting the current query
+ // Remove all background color attributes used by highlighting the current query
if([prefs boolForKey:@"CustomQueryHighlightCurrentQuery"]) {
- [[textView textStorage] removeAttribute:NSBackgroundColorAttributeName range:NSMakeRange(0,[[textView string] length])];
+ // Remove only the background attribute for the current range if still valid
+ NSRange textRange = NSMakeRange(0,[[textView string] length]);
+ NSRange r = NSIntersectionRange(currentQueryRange, textRange);
+ if(r.length)
+ [[textView textStorage] removeAttribute:NSBackgroundColorAttributeName range:r];
+ else
+ [[textView textStorage] removeAttribute:NSBackgroundColorAttributeName range:textRange];
} else {
// ensure that we do it only once
if(hasBackgroundAttribute) {