This commit is contained in:
hrsh7th
2023-02-23 13:39:27 +09:00
parent ba7a53478d
commit 7cd39409e7
2 changed files with 4 additions and 1 deletions

View File

@@ -198,7 +198,7 @@ end
--- fuzzy
matcher.fuzzy = function(input, word, matches)
local input_index = matches[1] and (matches[1].input_match_end + 1) or 1
local input_index = matches[#matches] and (matches[#matches].input_match_end + 1) or 1
-- Lately specified middle of text.
for i = 1, #matches - 1 do

View File

@@ -37,6 +37,9 @@ describe('matcher', function()
assert.is.truthy(matcher.match('Unit', 'net.UnixListener', { disallow_partial_fuzzy_matching = true }) == 0)
assert.is.truthy(matcher.match('Unit', 'net.UnixListener', { disallow_partial_fuzzy_matching = false }) >= 1)
assert.is.truthy(matcher.match('emg', 'error_msg') >= 1)
assert.is.truthy(matcher.match('sasr', 'saved_splitright') >= 1)
local score, matches
score, matches = matcher.match('tail', 'HCDetails', {
disallow_fuzzy_matching = false,