Refactor cursor API in Editor

Co-authored-by: Neeraj Jaiswal <neerajj85@gmail.com>
This commit is contained in:
Héctor Ramón Jiménez 2025-12-01 19:40:36 +01:00
parent 2ac62f7512
commit 63e9eeffb5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 95 additions and 47 deletions

View file

@ -166,14 +166,17 @@ impl text::Editor for () {
}
fn cursor(&self) -> text::editor::Cursor {
text::editor::Cursor::Caret(Point::ORIGIN)
text::editor::Cursor {
position: text::editor::Position { line: 0, column: 0 },
selection: None,
}
}
fn cursor_position(&self) -> (usize, usize) {
(0, 0)
fn selection(&self) -> text::editor::Selection {
text::editor::Selection::Caret(Point::ORIGIN)
}
fn selection(&self) -> Option<String> {
fn copy(&self) -> Option<String> {
None
}