From 37e1b12b8126ec4281dee1e501eddef7064a1f35 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Thu, 21 Apr 2022 20:39:06 -0400 Subject: [PATCH] feat: add hilbish.completion.call to call a completer --- api.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api.go b/api.go index 5a72ddf..b2e4530 100644 --- a/api.go +++ b/api.go @@ -76,7 +76,7 @@ Check out the {blue}{bold}guide{reset} command to get started. util.SetField(rtm, mod, "login", rt.BoolValue(login), "Whether this is a login shell") util.SetField(rtm, mod, "greeting", rt.StringValue(greeting), "Hilbish's welcome message for interactive shells. It has Lunacolors formatting.") util.SetField(rtm, mod, "vimMode", rt.NilValue, "Current Vim mode of Hilbish (nil if not in Vim mode)") - util.SetField(rtm, hshMod, "exitCode", rt.IntValue(0), "Exit code of last exected command") + util.SetField(rtm, mod, "exitCode", rt.IntValue(0), "Exit code of last exected command") util.Document(mod, "Hilbish's core API, containing submodules and functions which relate to the shell itself.") // hilbish.userDir table @@ -118,6 +118,10 @@ Check out the {blue}{bold}guide{reset} command to get started. rt.FunctionValue(rt.NewGoFunction(luaBinaryComplete, "bins", 3, false)), "Completer for executables/binaries") + util.SetField(rtm, hshcomp, "call", + rt.FunctionValue(rt.NewGoFunction(callLuaCompleter, "call", 4, false)), + "Calls a completer and get its entries for completions") + util.Document(hshcomp, "Completions interface for Hilbish.") mod.Set(rt.StringValue("completion"), rt.TableValue(hshcomp))