Skip to main content

offset_to_utf16_line_col

Function offset_to_utf16_line_col 

Source
pub fn offset_to_utf16_line_col(text: &str, offset: usize) -> (u32, u32)
Expand description

Converts a byte offset into (line, column_utf16) coordinates.

Offsets beyond the end of the document are clamped to the last valid position.