Text editing operations: a mutable buffer plus a byte-offset cursor, and the operations that keep it ...
void move(EditableText &s, int n)
Move the cursor by n codepoints.
size_t previous_codepoint_offset(std::string_view text, size_t byte_offset)
Byte offset of the codepoint boundary before byte_offset.
std::string encode_utf8(uint32_t codepoint)
Encode a Unicode codepoint as a UTF-8 byte sequence.
bool is_control(uint32_t codepoint) noexcept
True if a codepoint must never be rasterized or treated as printable content.
size_t next_codepoint_offset(std::string_view text, size_t byte_offset)
Byte offset of the codepoint boundary after byte_offset.
void erase(EditableText &s, int n)
Erase n codepoints from the cursor.
void insert_codepoint(EditableText &s, uint32_t codepoint)
Insert one codepoint at the cursor, advancing it past the insert.
void insert_literal(EditableText &s, char c)
Insert one raw ASCII byte at the cursor, advancing it past the insert.
Mutable UTF-8 text plus a byte-offset cursor.