From 91f072a3a2e6d1440ebbc683637fcf62d563df28 Mon Sep 17 00:00:00 2001 From: Dmitry Maluka Date: Sat, 30 Sep 2023 23:39:25 +0200 Subject: [PATCH] Fix non-working lua Lock The lock provided to lua as micro.Lock does not really work: an attempt to use it via micro.Lock:Lock() results in an error: Plugin initlua: init:260: attempt to call a non-function object stack traceback: init:260: in main chunk [G]: ? The reason is that the value that is provided to lua is a copy of the mutex, not the mutex itself. Ref #1539 --- cmd/micro/initlua.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/micro/initlua.go b/cmd/micro/initlua.go index 3cbb3b2d0..5acb979d3 100644 --- a/cmd/micro/initlua.go +++ b/cmd/micro/initlua.go @@ -54,7 +54,7 @@ func luaImportMicro() *lua.LTable { ulua.L.SetField(pkg, "Tabs", luar.New(ulua.L, func() *action.TabList { return action.Tabs })) - ulua.L.SetField(pkg, "Lock", luar.New(ulua.L, ulua.Lock)) + ulua.L.SetField(pkg, "Lock", luar.New(ulua.L, &ulua.Lock)) return pkg }