Skip to main content

count_displayed_rows

Function count_displayed_rows 

Source
pub fn count_displayed_rows(
    content: &str,
    terminal_width: Option<usize>,
) -> usize
Expand description

Count displayed rows accounting for line wrapping

Uses unicode-width for accurate character width calculation, which handles CJK characters, emoji, and other wide characters. Strips ANSI escape sequences and expands tabs before calculation.