Skip to main content

Module span

Module span 

Source
Expand description

Shared span-to-Location conversion helpers used by format modules.

Functionsยง

char_count
UTF-8 character count in text[start_byte..end_byte].
is_single_line
Whether bytes contain no newline (single-line document).
line_column
1-based line and UTF-8 character column at byte_offset in text.
line_column_from_line
1-based line and UTF-8 character column at byte_offset in text.