Created
July 6, 2011 18:22
-
-
Save emmapersky/1067947 to your computer and use it in GitHub Desktop.
Adding regular expression table matching to SeqelPro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: Source/SPTablesList.m | |
=================================================================== | |
--- Source/SPTablesList.m (revision 3349) | |
+++ Source/SPTablesList.m (working copy) | |
@@ -1812,8 +1812,13 @@ | |
for (i = 0; i < [tables count]; i++) { | |
tableType = [[tableTypes objectAtIndex:i] integerValue]; | |
if (tableType == SPTableTypeNone) continue; | |
- substringRange = [[tables objectAtIndex:i] rangeOfString:[listFilterField stringValue] options:NSCaseInsensitiveSearch]; | |
- if (substringRange.location == NSNotFound) continue; | |
+ | |
+ // Check the tables against the input as a regexp, and if no match, check for substring matches | |
+ NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", [listFilterField stringValue]]; | |
+ if ([predicate evaluateWithObject:[tables objectAtIndex:i]] != YES) { | |
+ substringRange = [[tables objectAtIndex:i] rangeOfString:[listFilterField stringValue] options:NSCaseInsensitiveSearch]; | |
+ if (substringRange.location == NSNotFound) continue; | |
+ } | |
// Add a title if necessary | |
if ((tableType == SPTableTypeTable || tableType == SPTableTypeView) && lastTableType == NSNotFound |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment