Skip to content

status.fill

status.fill(
    spec,
) -> {
    kind: "span",
    text: string,
    fg: number | string?,
    bg: number | string?,
    bold: boolean?,
    italic: boolean?,
    underline: boolean?,
    dim: boolean?,
    reverse: boolean?,
    strikethrough: boolean?,
} | {
    kind: "fill",
    glyph: string?,
    fg: number | string?,
    bg: number | string?,
    bold: boolean?,
    italic: boolean?,
    underline: boolean?,
    dim: boolean?,
    reverse: boolean?,
    strikethrough: boolean?,
}

Build a fill element that absorbs the leftover width of the line when the line is laid out.

Accepts { glyph = "-", <style fields> }. glyph defaults to a space. Returns a fill element for status.flat.

local status = require('status')
local rule = status.fill { glyph = '-', dim = true }

Parameters

  • spec: {glyph: string?, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?}
    • glyph — The glyph to repeat. Absent defaults to a space in the layout pass. An empty string is a parse error.
    • fg
    • bg
    • bold
    • italic
    • underline
    • dim
    • reverse
    • strikethrough

Returns

  • {kind: "span", text: string, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?} | {kind: "fill", glyph: string?, fg: number | string?, bg: number | string?, bold: boolean?, italic: boolean?, underline: boolean?, dim: boolean?, reverse: boolean?, strikethrough: boolean?}
    • kind
    • text — The text of the run, unsanitized. Sanitization is deferred to the layout pass.
    • fg
    • bg
    • bold
    • italic
    • underline
    • dim
    • reverse
    • strikethrough
    • kind
    • glyph — The glyph to repeat. Absent defaults to a space in the layout pass. An empty string is a parse error.
    • fg
    • bg
    • bold
    • italic
    • underline
    • dim
    • reverse
    • strikethrough