mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(lua): double entries in :lua completion #19410
`:lua vim.ls<tab>` would list `lsp` twice.
This commit is contained in:
@@ -614,7 +614,7 @@ function vim._expand_pat(pat, env)
|
|||||||
local function insert_keys(obj)
|
local function insert_keys(obj)
|
||||||
for k, _ in pairs(obj) do
|
for k, _ in pairs(obj) do
|
||||||
if type(k) == 'string' and string.sub(k, 1, string.len(match_part)) == match_part then
|
if type(k) == 'string' and string.sub(k, 1, string.len(match_part)) == match_part then
|
||||||
table.insert(keys, k)
|
keys[k] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -630,6 +630,7 @@ function vim._expand_pat(pat, env)
|
|||||||
insert_keys(vim._submodules)
|
insert_keys(vim._submodules)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
keys = vim.tbl_keys(keys)
|
||||||
table.sort(keys)
|
table.sort(keys)
|
||||||
|
|
||||||
return keys, #prefix_match_pat
|
return keys, #prefix_match_pat
|
||||||
|
Reference in New Issue
Block a user