mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
Update ftoptions and statusline plugin configuration options
This commit is contained in:
@@ -7,8 +7,10 @@ import (
|
||||
luar "layeh.com/gopher-luar"
|
||||
|
||||
"github.com/zyedidia/micro/internal/action"
|
||||
"github.com/zyedidia/micro/internal/display"
|
||||
ulua "github.com/zyedidia/micro/internal/lua"
|
||||
"github.com/zyedidia/micro/internal/screen"
|
||||
"github.com/zyedidia/micro/internal/shell"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -17,9 +19,12 @@ func init() {
|
||||
}
|
||||
|
||||
func LuaImport(pkg string) *lua.LTable {
|
||||
if pkg == "micro" {
|
||||
switch pkg {
|
||||
case "micro":
|
||||
return luaImportMicro()
|
||||
} else {
|
||||
case "micro/shell":
|
||||
return luaImportMicroShell()
|
||||
default:
|
||||
return ulua.Import(pkg)
|
||||
}
|
||||
}
|
||||
@@ -31,7 +36,19 @@ func luaImportMicro() *lua.LTable {
|
||||
ulua.L.SetField(pkg, "TermError", luar.New(ulua.L, screen.TermError))
|
||||
ulua.L.SetField(pkg, "InfoBar", luar.New(ulua.L, action.GetInfoBar))
|
||||
ulua.L.SetField(pkg, "Log", luar.New(ulua.L, log.Println))
|
||||
ulua.L.SetField(pkg, "TryBindKey", luar.New(ulua.L, action.TryBindKey))
|
||||
ulua.L.SetField(pkg, "SetStatusInfoFn", luar.New(ulua.L, display.SetStatusInfoFnLua))
|
||||
// ulua.L.SetField(pkg, "TryBindKey", luar.New(ulua.L, action.TryBindKey))
|
||||
|
||||
return pkg
|
||||
}
|
||||
|
||||
func luaImportMicroShell() *lua.LTable {
|
||||
pkg := ulua.L.NewTable()
|
||||
|
||||
ulua.L.SetField(pkg, "ExecCommand", luar.New(ulua.L, shell.ExecCommand))
|
||||
ulua.L.SetField(pkg, "RunCommand", luar.New(ulua.L, shell.RunCommand))
|
||||
ulua.L.SetField(pkg, "RunBackgroundShell", luar.New(ulua.L, shell.RunBackgroundShell))
|
||||
ulua.L.SetField(pkg, "RunInteractiveShell", luar.New(ulua.L, shell.RunInteractiveShell))
|
||||
|
||||
return pkg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user