Skip to main content

select_word_at_byte

Function select_word_at_byte 

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

Expand a byte offset into a word range using Unicode word boundaries. Returns (start, end) in bytes; start == end == byte when the click landed on whitespace.