From 61092fbb998fa6ede9e7aefd8baf774a17466d7d Mon Sep 17 00:00:00 2001 From: rxi Date: Sat, 23 May 2020 14:30:24 +0100 Subject: [PATCH] Changed fuzzy matching to favour matching case --- src/api/system.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/system.c b/src/api/system.c index 35843a00..235d5824 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -363,11 +363,11 @@ static int f_fuzzy_match(lua_State *L) { while (*str == ' ') { str++; } while (*ptn == ' ') { ptn++; } if (tolower(*str) == tolower(*ptn)) { - score += run; + score += run * 10 - (*str != *ptn); run++; ptn++; } else { - score--; + score -= 10; run = 0; } str++;