Skip to main content

word_at_caret

Function word_at_caret 

pub fn word_at_caret(text: &str, caret: usize) -> Option<Range<usize>>
Expand description

The word the caret is in or just after, as a byte range: letters plus in-word apostrophes, so don't is one word. None between words.