summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2016-06-26 23:10:25 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2016-07-10 12:54:19 -0700
commit5c2d67ca7a14cfad94a5718ea62ad1b4d31f73b6 (patch)
tree691a68254940adf4b6dc7fe4684b4ff2da27043e /src
parent95eb1c06231c5a32724402a589f9b07274194a2f (diff)
Don't consider numbers word separators
This made sense on paper when deciding what was a "word". However in reality this is rarely an indication of a separate word. I've found that this caused hexadecimal or base64 strings to be favoured in matches.
Diffstat (limited to 'src')
-rw-r--r--src/match.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/match.c b/src/match.c
index 6b3b0ad..855b067 100644
--- a/src/match.c
+++ b/src/match.c
@@ -66,8 +66,7 @@ static void precompute_bonus(const char *haystack, score_t *match_bonus) {
if (isalnum(ch)) {
if (!last_ch || last_ch == '/') {
score = SCORE_MATCH_SLASH;
- } else if (last_ch == '-' || last_ch == '_' || last_ch == ' ' ||
- (last_ch >= '0' && last_ch <= '9')) {
+ } else if (last_ch == '-' || last_ch == '_' || last_ch == ' ') {
score = SCORE_MATCH_WORD;
} else if (last_ch >= 'a' && last_ch <= 'z' && ch >= 'A' && ch <= 'Z') {
/* CamelCase */