Revision: 10970
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=10970&view=rev
Author:   amaxwell
Date:     2007-08-22 16:44:29 -0700 (Wed, 22 Aug 2007)

Log Message:
-----------
Workaround for bug #1779548, where searches that include punctuation characters 
can return unexpected results.  Now we highlight more aggressively, so possible 
matches should be evident.

Modified Paths:
--------------
    trunk/bibdesk/NSTextView_BDSKExtensions.m

Modified: trunk/bibdesk/NSTextView_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSTextView_BDSKExtensions.m   2007-08-22 14:03:54 UTC (rev 
10969)
+++ trunk/bibdesk/NSTextView_BDSKExtensions.m   2007-08-22 23:44:29 UTC (rev 
10970)
@@ -100,8 +100,12 @@
     NSTextStorage *textStorage = [self textStorage];
 
     static NSCharacterSet *charactersToRemove = nil;
-    if (nil == charactersToRemove)
-        charactersToRemove = [[NSCharacterSet 
characterSetWithCharactersInString:@"\"!*()|&"] copy];
+    if (nil == charactersToRemove) {
+        // SearchKit ignores punctuation, so results can be surprising.  In 
bug #1779548 the user was trying to search for a literal "ic.8" with the 
default wildcard expansion.  This translated into a large number of matches, 
but nothing was highlighted in the textview because we only removed SearchKit 
special characters.
+        NSMutableCharacterSet *ms = (id)[NSMutableCharacterSet 
characterSetWithCharactersInString:@"\"!*()|&"];
+        [ms formUnionWithCharacterSet:[NSCharacterSet 
punctuationCharacterSet]];
+        charactersToRemove = [ms copy];
+    }
     
     NSMutableString *mutableString = [searchString mutableCopy];
     


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to