Skip to main content

compute_visible_separator_marks

Function compute_visible_separator_marks 

Source
pub fn compute_visible_separator_marks(
    marks: &[ScrollbackMark],
    scrollback_len: usize,
    scroll_offset: usize,
    visible_lines: usize,
) -> Vec<SeparatorMark> 
Expand description

Compute which separator marks are visible in the current viewport.

Maps absolute scrollback line numbers to screen rows for the current view. Deduplicates marks that are close together (e.g., multi-line prompts generate both a PromptStart and CommandStart mark within a few lines). When marks are within MERGE_THRESHOLD lines of each other, they are merged — keeping the earliest screen row (from PromptStart) while inheriting exit code and color from whichever mark carries them.