mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
@@ -56,6 +56,7 @@ func luaImportMicro() *lua.LTable {
|
|||||||
ulua.L.SetField(pkg, "Tabs", luar.New(ulua.L, func() *action.TabList {
|
ulua.L.SetField(pkg, "Tabs", luar.New(ulua.L, func() *action.TabList {
|
||||||
return action.Tabs
|
return action.Tabs
|
||||||
}))
|
}))
|
||||||
|
ulua.L.SetField(pkg, "Lock", luar.New(ulua.L, ulua.Lock))
|
||||||
|
|
||||||
return pkg
|
return pkg
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/zyedidia/micro/v2/internal/action"
|
"github.com/zyedidia/micro/v2/internal/action"
|
||||||
"github.com/zyedidia/micro/v2/internal/buffer"
|
"github.com/zyedidia/micro/v2/internal/buffer"
|
||||||
"github.com/zyedidia/micro/v2/internal/config"
|
"github.com/zyedidia/micro/v2/internal/config"
|
||||||
|
ulua "github.com/zyedidia/micro/v2/internal/lua"
|
||||||
"github.com/zyedidia/micro/v2/internal/screen"
|
"github.com/zyedidia/micro/v2/internal/screen"
|
||||||
"github.com/zyedidia/micro/v2/internal/shell"
|
"github.com/zyedidia/micro/v2/internal/shell"
|
||||||
"github.com/zyedidia/micro/v2/internal/util"
|
"github.com/zyedidia/micro/v2/internal/util"
|
||||||
@@ -344,7 +345,9 @@ func main() {
|
|||||||
// okay to be inefficient and run it via a function every time
|
// okay to be inefficient and run it via a function every time
|
||||||
// We do this so we can recover from panics without crashing the editor
|
// We do this so we can recover from panics without crashing the editor
|
||||||
for {
|
for {
|
||||||
|
ulua.Lock.Lock()
|
||||||
DoEvent()
|
DoEvent()
|
||||||
|
ulua.Lock.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var L *lua.LState
|
var L *lua.LState
|
||||||
|
var Lock sync.Mutex
|
||||||
|
|
||||||
// LoadFile loads a lua file
|
// LoadFile loads a lua file
|
||||||
func LoadFile(module string, file string, data []byte) error {
|
func LoadFile(module string, file string, data []byte) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user