Skip to main content

select_line_at_byte

Function select_line_at_byte 

Source
pub fn select_line_at_byte(text: &str, byte: usize) -> (usize, usize)
Expand description

Expand a byte offset into a line range. \n is excluded from the end of the range so a triple-click select-then-replace doesn’t eat the newline.