commit 9169fb8f07238efd9fd0d0781c64c04abd1fa1ce
parent 9f4b19b6d029263d40b099669a57abbd807fd86e
Author: ii14 <59243201+ii14@users.noreply.github.com>
Date: Mon, 18 Jul 2022 00:40:18 +0200
fix(lua): double entries in :lua completion #19410
`:lua vim.ls<tab>` would list `lsp` twice.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
@@ -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