+13
-0
lines changedFilter options
+13
-0
lines changed Original file line number Diff line number Diff line change
@@ -519,6 +519,8 @@ function vim._expand_pat(pat, env)
519
519
local mt = getmetatable(final_env)
520
520
if mt and type(mt.__index) == "table" then
521
521
field = rawget(mt.__index, key)
522
+
elseif final_env == vim and vim._submodules[key] then
523
+
field = vim[key]
522
524
end
523
525
end
524
526
final_env = field
@@ -545,6 +547,9 @@ function vim._expand_pat(pat, env)
545
547
if mt and type(mt.__index) == "table" then
546
548
insert_keys(mt.__index)
547
549
end
550
+
if final_env == vim then
551
+
insert_keys(vim._submodules)
552
+
end
548
553
549
554
table.sort(keys)
550
555
Original file line number Diff line number Diff line change
@@ -106,6 +106,14 @@ describe('nlua_expand_pat', function()
106
106
)
107
107
end)
108
108
109
+
it('should work with lazy submodules of "vim" global', function()
110
+
eq({{ 'inspect' }, 4 },
111
+
get_completions('vim.inspec'))
112
+
113
+
eq({{ 'set' }, 11 },
114
+
get_completions('vim.keymap.se'))
115
+
end)
116
+
109
117
it('should be able to interpolate globals', function()
110
118
eq(
111
119
{{
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4