diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-06-06 11:58:32 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-06-06 11:58:32 +0000 |
commit | 9f431c3e9faf9c1d6a66d192e5405203f65ca77c (patch) | |
tree | e961534dd88c67134c22a5c0c0ddfdd4696e94d3 | |
parent | f6e926b95da15e963545805345d5afca3db0455e (diff) | |
download | sequelpro-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
-rw-r--r-- | Source/CMTextView.m | 3 | ||||
-rw-r--r-- | Source/CustomQuery.m | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m index a6f7cabc..d15a9f5b 100644 --- a/Source/CMTextView.m +++ b/Source/CMTextView.m @@ -1180,6 +1180,9 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) @"DELAYED", @"DELAY_KEY_WRITE", @"DELETE", + @"DELIMITER ", + @"DELIMITER ;\n", + @"DELIMITER ;;\n", @"DESC", @"DESCRIBE", @"DES_KEY_FILE", 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) { |