mirror of
https://github.com/hrsh7th/cmp-buffer
synced 2025-04-11 04:01:32 +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)
|
local s, e = self:matchstrpos(buf)
|
||||||
if s then
|
if s then
|
||||||
local word = string.sub(buf, s, e - 1)
|
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)
|
table.insert(words, word)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -28,11 +28,12 @@ source.complete = function(self, request, callback)
|
|||||||
end
|
end
|
||||||
|
|
||||||
vim.defer_fn(vim.schedule_wrap(function()
|
vim.defer_fn(vim.schedule_wrap(function()
|
||||||
|
local input = string.sub(request.context.cursor_before_line, request.offset)
|
||||||
local items = {}
|
local items = {}
|
||||||
local words = {}
|
local words = {}
|
||||||
for _, buf in ipairs(self:_get_buffers(request)) do
|
for _, buf in ipairs(self:_get_buffers(request)) do
|
||||||
for _, word in ipairs(buf:get_words()) 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
|
words[word] = true
|
||||||
table.insert(items, {
|
table.insert(items, {
|
||||||
label = word,
|
label = word,
|
||||||
|
Loading…
Reference in New Issue
Block a user