Function difft::display::style::byte_offset_for_width
source · fn byte_offset_for_width(s: &str, width: usize, tab_width: usize) -> usize
Expand description
Find the largest byte offset in s
that gives the longest
starting substring whose display width does not exceed width
.
If s
contains full-width Unicode characters, or emoji, or tabs,
its display width may be less than width
.