Skip to main content

Module movement

Module movement 

Source
Expand description

Text movement and boundary calculation primitives.

Enums§

CharKind
Character classification used for word-boundary detection.

Functions§

classify_char
Classifies a character into CharKind.
find_line_end
Returns the byte offset of the end of the line containing cursor_byte, excluding trailing newline characters (\r\n or \n).
find_line_range_at
Returns the byte range of the full line containing cursor_byte, including any trailing line terminator (\n or \r\n).
find_line_start
Returns the byte offset of the beginning of the line containing cursor_byte.
find_next_word_end
Finds the end offset of the current word or next word moving forward from cursor_byte.
find_prev_word_start
Finds the start offset of the previous word (or punctuation token) moving backward from cursor_byte.
find_word_range_at
Finds the byte range of the word, punctuation token, or whitespace run containing cursor_byte.