Skip to main content

line_boundaries

Function line_boundaries 

pub fn line_boundaries(text: &str, byte_idx: usize) -> (usize, usize)
Expand description

Byte range (start, end) of the line containing byte_idx, where lines are linefeed-delimited (\n). The end is the index of the trailing \n, or text.len() for the final line. Triple-click line selection uses this.