Skip to content

Commit

Permalink
added NewLogBuffer and NewScratchBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias314 committed Dec 21, 2024
1 parent 3d9e45b commit 52b0a9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/micro/initlua.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ func luaImportMicroBuffer() *lua.LTable {
ulua.L.SetField(pkg, "NewBuffer", luar.New(ulua.L, func(text, path string) *buffer.Buffer {
return buffer.NewBufferFromString(text, path, buffer.BTDefault)
}))
ulua.L.SetField(pkg, "NewLogBuffer", luar.New(ulua.L, func(text, path string) *buffer.Buffer {
return buffer.NewBufferFromString(text, path, buffer.BTLog)
}))
ulua.L.SetField(pkg, "NewScratchBuffer", luar.New(ulua.L, func(text, path string) *buffer.Buffer {
return buffer.NewBufferFromString(text, path, buffer.BTScratch)
}))
ulua.L.SetField(pkg, "NewBufferFromFile", luar.New(ulua.L, func(path string) (*buffer.Buffer, error) {
return buffer.NewBufferFromFile(path, buffer.BTDefault)
}))
Expand Down

0 comments on commit 52b0a9f

Please sign in to comment.