Skip to main content

leading_visual_width

Function leading_visual_width 

Source
pub fn leading_visual_width(line: &str, tab_width: usize) -> usize
Expand description

Visual width of line’s leading run of whitespace: ' ' occupies one cell, '\t' advances to the next multiple of tab_width, and the walk stops at the first other char. The indent-guide renderers in both TUI layers compute exactly this to decide where guides may be painted.