Skip to main content

cursor_byte_offset

Function cursor_byte_offset 

Source
pub(crate) fn cursor_byte_offset(text: &str, pos: Position) -> usize
Expand description

The byte offset of an LSP (line, character) position in text. Mirrors the line_prefix computation (character as a byte index — ASCII-faithful).