Lua prompt support and plugin improvements

This commit is contained in:
Zachary Yedidia
2019-12-24 17:17:44 -05:00
parent 3b306c1d3b
commit 94ff79e7b2
8 changed files with 87 additions and 25 deletions

View File

@@ -89,11 +89,7 @@ func LuaFunctionCommand(fn string) func(*BufPane, []string) {
return nil
}
return func(bp *BufPane, args []string) {
var luaArgs []lua.LValue
luaArgs = append(luaArgs, luar.New(ulua.L, bp))
for _, v := range args {
luaArgs = append(luaArgs, luar.New(ulua.L, v))
}
luaArgs := []lua.LValue{luar.New(ulua.L, bp), luar.New(ulua.L, args)}
_, err := pl.Call(plFn, luaArgs...)
if err != nil {
screen.TermMessage(err)