Skip to main content

visual_width

Function visual_width 

Source
pub fn visual_width(s: &str, start_col: usize) -> usize
Expand description

Calculate visual width of a string, handling ANSI escapes and tabs

This is the canonical function for visual width calculation. Use this instead of str_width() when the text may contain ANSI codes or tabs.