From 5ed60804fe69e97a699ca64422f4f7f4cc20f3da Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 9 Mar 2022 14:26:01 +0100 Subject: feat(lua): handle lazy submodules in `:lua vim.` wildmenu completion --- runtime/lua/vim/_editor.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/lua/vim/_editor.lua') diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 2251aca004..3136e36043 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -519,6 +519,8 @@ function vim._expand_pat(pat, env) local mt = getmetatable(final_env) if mt and type(mt.__index) == "table" then field = rawget(mt.__index, key) + elseif final_env == vim and vim._submodules[key] then + field = vim[key] end end final_env = field @@ -545,6 +547,9 @@ function vim._expand_pat(pat, env) if mt and type(mt.__index) == "table" then insert_keys(mt.__index) end + if final_env == vim then + insert_keys(vim._submodules) + end table.sort(keys) -- cgit