mirror of
https://github.com/hrsh7th/cmp-buffer
synced 2025-04-07 18:14:45 +00:00
Fix digits pattern
This commit is contained in:
parent
2dbb474a7e
commit
1864f3950e
@ -99,7 +99,7 @@ function buffer.index_line(self, i, line)
|
||||
local s, e = self:matchstrpos(buf)
|
||||
if s then
|
||||
local word = string.sub(buf, s, e - 1)
|
||||
if #word > 1 and string.match(word, '%a$') then
|
||||
if #word > 1 and string.match(word, '[%a%d]$') then
|
||||
table.insert(words, word)
|
||||
end
|
||||
end
|
||||
|
@ -28,11 +28,12 @@ source.complete = function(self, request, callback)
|
||||
end
|
||||
|
||||
vim.defer_fn(vim.schedule_wrap(function()
|
||||
local input = string.sub(request.context.cursor_before_line, request.offset)
|
||||
local items = {}
|
||||
local words = {}
|
||||
for _, buf in ipairs(self:_get_buffers(request)) do
|
||||
for _, word in ipairs(buf:get_words()) do
|
||||
if not words[word] then
|
||||
if not words[word] and input ~= word then
|
||||
words[word] = true
|
||||
table.insert(items, {
|
||||
label = word,
|
||||
|
Loading…
Reference in New Issue
Block a user