Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/micro/initlua.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func luaImportMicro() *lua.LTable {
ulua.L.SetField(pkg, "Tabs", luar.New(ulua.L, func() *action.TabList {
return action.Tabs
}))
ulua.L.SetField(pkg, "NewTabFromBuffer", luar.New(ulua.L, action.NewTabFromBuffer))
ulua.L.SetField(pkg, "After", luar.New(ulua.L, func(t time.Duration, f func()) {
time.AfterFunc(t, func() {
timerChan <- f
Expand Down
3 changes: 3 additions & 0 deletions runtime/help/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ The packages and their contents are listed below (in Go type signatures):

- `Tabs() *TabList`: returns the global tab list.

- `NewTabFromBuffer(x, y, width, height int, buf *Buffer) *Tab`: creates
a new tab from the given buffer with the specified dimensions and position.

- `After(t time.Duration, f func())`: run function `f` in the background
after time `t` elapses. See https://pkg.go.dev/time#Duration for the
usage of `time.Duration`.
Expand Down