Skip to main content

collapse_blank_lines

Function collapse_blank_lines 

Source
pub fn collapse_blank_lines(lines: Vec<Line<'static>>) -> Vec<Line<'static>>
Expand description

Drop runs of 2+ consecutive whitespace-only Lines, keeping at most one.

Why: markdown-style \n\n paragraph breaks and the renderer’s own inter-message spacer can compound into a run of several blank rows; collapsing them to one keeps the scrollback dense. What: operates after wrapping decisions but before pad/scroll math, so the geometry math sees the post-collapse line count. Test: tests::collapse_blank_lines_drops_consecutive_empty_lines.