diff --git a/lua/cmp/matcher_spec.lua b/lua/cmp/matcher_spec.lua index 65ac89c..1f8b0d1 100644 --- a/lua/cmp/matcher_spec.lua +++ b/lua/cmp/matcher_spec.lua @@ -29,6 +29,7 @@ describe('matcher', function() assert.is.truthy(matcher.match('usela', 'useLayoutEffect') > matcher.match('usela', 'useDataLayer')) assert.is.truthy(matcher.match('true', 'v:true', { 'true' }) == matcher.match('true', 'true')) assert.is.truthy(matcher.match('g', 'get', { 'get' }) > matcher.match('g', 'dein#get', { 'dein#get' })) + assert.is.truthy(matcher.match('2', '[[2021') >= 1) end) it('debug', function() diff --git a/lua/cmp/utils/char.lua b/lua/cmp/utils/char.lua index fa85fdd..12a1809 100644 --- a/lua/cmp/utils/char.lua +++ b/lua/cmp/utils/char.lua @@ -82,6 +82,9 @@ char.is_semantic_index = function(text, index) if not char.is_alpha(prev) and char.is_alpha(curr) then return true end + if not char.is_digit(prev) and char.is_digit(curr) then + return true + end return false end