Fix fuzzy match bug
This commit is contained in:
@@ -187,7 +187,7 @@ matcher.fuzzy = function(input, word, matches)
|
|||||||
end
|
end
|
||||||
word_offset = word_offset + 1
|
word_offset = word_offset + 1
|
||||||
end
|
end
|
||||||
if input_index >= #input then
|
if input_index > #input then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -22,14 +22,13 @@ describe('matcher', function()
|
|||||||
assert.is.truthy(matcher.match('var_', 'var_dump') >= 1)
|
assert.is.truthy(matcher.match('var_', 'var_dump') >= 1)
|
||||||
assert.is.truthy(matcher.match('my_', 'my_awesome_variable') > matcher.match('my_', 'completion_matching_strategy_list'))
|
assert.is.truthy(matcher.match('my_', 'my_awesome_variable') > matcher.match('my_', 'completion_matching_strategy_list'))
|
||||||
assert.is.truthy(matcher.match('luacon', 'lua_context') > matcher.match('luacon', 'LuaContext'))
|
assert.is.truthy(matcher.match('luacon', 'lua_context') > matcher.match('luacon', 'LuaContext'))
|
||||||
|
assert.is.truthy(matcher.match('call', 'calc') == 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('debug', function()
|
it('debug', function()
|
||||||
assert.is.truthy(true)
|
|
||||||
|
|
||||||
matcher.debug = function(...)
|
matcher.debug = function(...)
|
||||||
print(vim.inspect({ ... }))
|
print(vim.inspect({ ... }))
|
||||||
end
|
end
|
||||||
print('score', matcher.match('vsnipnextjump', 'vsnip-jump-next'))
|
-- print('score', matcher.match('vsnipnextjump', 'vsnip-jump-next'))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user