aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2022-07-18 00:40:18 +0200
committerGitHub <noreply@github.com>2022-07-17 15:40:18 -0700
commit9169fb8f07238efd9fd0d0781c64c04abd1fa1ce (patch)
treef9f41ebb9e6a5e5c2ac007a4ceb1c98fbf06a468
parent9f4b19b6d029263d40b099669a57abbd807fd86e (diff)
downloadrneovim-9169fb8f07238efd9fd0d0781c64c04abd1fa1ce.tar.gz
rneovim-9169fb8f07238efd9fd0d0781c64c04abd1fa1ce.tar.bz2
rneovim-9169fb8f07238efd9fd0d0781c64c04abd1fa1ce.zip
fix(lua): double entries in :lua completion #19410
`:lua vim.ls<tab>` would list `lsp` twice.
-rw-r--r--runtime/lua/vim/_editor.lua3
1 files changed, 2 insertions, 1 deletions
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