mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +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)
|
||||
for k, _ in pairs(obj) do
|
||||
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
|
||||
@@ -630,6 +630,7 @@ function vim._expand_pat(pat, env)
|
||||
insert_keys(vim._submodules)
|
||||
end
|
||||
|
||||
keys = vim.tbl_keys(keys)
|
||||
table.sort(keys)
|
||||
|
||||
return keys, #prefix_match_pat
|
||||
|
Reference in New Issue
Block a user