diff options
Diffstat (limited to 'Source')
-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) { |