Skip to content

smelt.buf

Availability: Terminal UI only; raises in headless mode.

Advanced: Low-level building block for plugins that need full control. It may change more freely than the rest of the API.

Buffer handle constructor. smelt.buf.new(opts?) returns a Buf userdata. opts.name opts the buffer into hot-reload survival - repeat calls with the same name return the same handle with mutable opts re-applied. Anonymous buffers are reaped on /reload. UiHost-only - buffers are terminal-screen backing stores that windows render into.

smelt.buf.new

fun(opts: smelt.buf.NewOpts?): smelt.buf.Buf

Types: smelt.buf.NewOpts, smelt.buf.Buf

Create a buffer and return a Buf userdata. opts.name opts the buffer into hot-reload survival. Repeat calls with the same name return the same handle with mutable opts re-applied. When omitted from a module body, a stable per-(plugin, declaration-index) name is auto-assigned so the buffer survives /reload without explicit naming.