From 9169fb8f07238efd9fd0d0781c64c04abd1fa1ce Mon Sep 17 00:00:00 2001 From: ii14 <59243201+ii14@users.noreply.github.com> Date: Mon, 18 Jul 2022 00:40:18 +0200 Subject: fix(lua): double entries in :lua completion #19410 `:lua vim.ls` would list `lsp` twice. --- runtime/lua/vim/_editor.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/_editor.lua') diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index c4cc151bca..442d7b07d8 100644 --- 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 -- cgit