Skip to main content

prev_word_boundary

Function prev_word_boundary 

pub fn prev_word_boundary(text: &str, byte_idx: usize) -> usize
Expand description

Walk back to the previous UAX #29 word start. If the cursor is inside a word this returns that word’s start; at its start it returns the preceding word’s start. The result is always a UTF-8 boundary.