pub fn window(text: &str, left_col: usize, tab_width: usize) -> (&str, usize)Expand description
Drop left_col display columns from the front of a line.
Returns the remaining text and how many graphemes were dropped, because the caller still has to line the result up against selections that are stated in grapheme columns.
A wide grapheme straddling the boundary is dropped entirely rather than half-drawn: a terminal cannot render half a cell, so the alternatives are a dropped character or a row one column out of alignment with every other row. Slicing by display column rather than by grapheme is the whole point — a line of CJK scrolls by cells the way it is drawn.