Skip to main content

run_lines_with_context

Function run_lines_with_context 

Source
pub fn run_lines_with_context(
    reader: impl Read,
    writer: impl Write,
    stderr: &mut dyn Write,
    lines: &[&[LineItem]],
    ctx: &RunContext<'_>,
) -> Result<()>
Expand description

Multi-line render entry. Each inner slice is one rendered line; the layout algorithm runs independently per line with the full terminal width budget. Stdin is parsed once into a shared DataContext so every line sees the same data snapshot. Empty inner slices still emit a writeln!() — the user explicitly defined the line slot, so it stays in the output even if no segments rendered.

Parse failures emit a single ? marker on the first line and stop, matching the single-line failure mode (the marker tells Claude Code “linesmith ran but couldn’t parse stdin”; emitting a per-line marker would be visually noisy without conveying more information).

§Errors

Returns the first io::Error from a writeln! to writer. Stderr write failures are swallowed.