Skip to main content

segment_for_col

Function segment_for_col 

Source
pub fn segment_for_col(segments: &[(usize, usize)], col: usize) -> usize
Expand description

Returns the index into segments whose [start, end) covers col. The past-end cursor (col == last segment's end) maps to the last segment, matching vim’s “EOL on the visual row that holds the line’s last char” behaviour.