1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Text storage and editing with styled segments.
//!
//! This module provides rope-backed text buffers for efficient editing of
//! large documents.
//!
//! # Grapheme Pool Policy
//!
//! This module's public API uses `&str` for text content, keeping grapheme pool
//! details internal. Multi-codepoint grapheme clusters (emoji, ZWJ sequences) are
//! handled transparently during rendering using [`crate::GraphemeId::placeholder`] for
//! width-aware layout without pool allocation. Users needing direct grapheme pool
//! access should use [`crate::GraphemePool`] and [`crate::GraphemeId`] from the crate root.
//!
//! Key types:
//!
//! - [`TextBuffer`]: Styled text storage with syntax highlighting support
//! - [`EditBuffer`]: Editable buffer with cursor movement and undo/redo
//! - [`EditorView`]: Visual rendering with line numbers and selection
//! - [`TextBufferView`]: Viewport configuration with wrapping modes
//!
//! # Examples
//!
//! ## Basic Text Buffer
//!
//! ```
//! use opentui_rust::TextBuffer;
//!
//! let buffer = TextBuffer::with_text("Hello, world!");
//! assert_eq!(buffer.len_chars(), 13);
//! assert_eq!(buffer.len_lines(), 1);
//! ```
//!
//! ## Editable Buffer with Undo
//!
//! ```
//! use opentui_rust::EditBuffer;
//!
//! let mut editor = EditBuffer::new();
//! editor.insert("Hello");
//! editor.commit(); // Create undo checkpoint
//! editor.insert(" World");
//! editor.commit();
//! assert_eq!(editor.text(), "Hello World");
//!
//! // Undo the last insert
//! editor.undo();
//! assert_eq!(editor.text(), "Hello");
//!
//! // Redo brings it back
//! editor.redo();
//! assert_eq!(editor.text(), "Hello World");
//! ```
pub use TextBuffer;
pub use EditBuffer;
pub use ;
pub use RopeWrapper;
pub use StyledSegment;
pub use ;