Function piet::util::line_number_for_position
source · pub fn line_number_for_position(lines: &[LineMetric], position: usize) -> usize
Expand description
Returns the index of the line containing this utf8 position, or the last line index if the position is out of bounds.
lines
must not be empty.