feat(lua): omnifunc for builting lua interpreter

also make implicit submodules "uri" and "_inspector" work with completion

this is needed for `:lua=vim.uri_<tab>` wildmenu completion
to work even before uri or _inspector functions are used.
This commit is contained in:
Björn Linse
2021-01-27 09:00:28 +01:00
committed by bfredl
parent ed05d38d9f
commit 79571b92ce
6 changed files with 79 additions and 6 deletions

View File

@@ -1872,6 +1872,12 @@ int nlua_expand_pat(expand_T *xp, char *pat, int *num_results, char ***results)
lua_getfield(lstate, -1, "_expand_pat");
luaL_checktype(lstate, -1, LUA_TFUNCTION);
// ex expansion prepends a ^, but don't worry, it is not a regex
if (pat[0] != '^') {
return FAIL;
}
pat++;
// [ vim, vim._expand_pat, buf ]
lua_pushlstring(lstate, (const char *)pat, strlen(pat));