diff options
author | Max <post@wickenrode.com> | 2015-09-26 03:55:26 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-09-26 03:55:26 +0200 |
commit | 7cd8cce7b997fa965e2d2430b0db9a04f6bc6dfc (patch) | |
tree | b07e70d7e7e0b57802127659c5871941d54748fe /Source/SPStringAdditions.h | |
parent | 1830a824116f569c6e5ab75116b30cbab4309885 (diff) | |
download | sequelpro-7cd8cce7b997fa965e2d2430b0db9a04f6bc6dfc.tar.gz sequelpro-7cd8cce7b997fa965e2d2430b0db9a04f6bc6dfc.tar.bz2 sequelpro-7cd8cce7b997fa965e2d2430b0db9a04f6bc6dfc.zip |
Improve the search method in "Go To Database" to sort results in a more relevant order
Diffstat (limited to 'Source/SPStringAdditions.h')
-rw-r--r-- | Source/SPStringAdditions.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/SPStringAdditions.h b/Source/SPStringAdditions.h index 5f1c0e6d..de6d8377 100644 --- a/Source/SPStringAdditions.h +++ b/Source/SPStringAdditions.h @@ -88,6 +88,10 @@ static inline id NSMutableAttributedStringAttributeAtIndex(NSMutableAttributedSt * Namely the following options will be applied when matching: * NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch|NSWidthInsensitiveSearch * Additionaly this method might match even when it should not. + * A regular substring test is always included. Therefore looking e.g. for "abc" in + * "axbxabc" would match as (axbx,"abc") and NOT as ("a",x,"b",xab,"c"). + * Partial submatches will likewise be optimized to return as few matches as possible. + * E.g. ".123" in "a._1_12_123" will return (a,".",_1_12_,"123") NOT (a,".",_,"1",_1,"2",_12,"3") * * @param other String to match against self * @param submatches Pass the pointer to a variable that will be set to an NSArray * |