text-document
A rich text document model for Rust.
Provides a [TextDocument] as the main entry point and [TextCursor] for
cursor-based editing, inspired by Qt's QTextDocument/QTextCursor API.
use ;
let doc = new;
doc.set_plain_text.unwrap;
let cursor = doc.cursor;
cursor.move_position;
cursor.insert_text.unwrap; // replaces "Hello"
// Multiple cursors on the same document
let c1 = doc.cursor;
let c2 = doc.cursor_at;
c1.insert_text.unwrap;
// c2's position is automatically adjusted
doc.undo.unwrap;