mirror of
https://github.com/msfjarvis/text-editor.git
synced 2024-06-03 04:18:57 +05:30
feat(editor): make Editor
carry a Document
This commit is contained in:
parent
5f7572fd55
commit
6b893fdbd9
|
@ -1,4 +1,4 @@
|
|||
use crate::Terminal;
|
||||
use crate::{Document, Terminal};
|
||||
use std::io;
|
||||
use std::result::Result;
|
||||
use termion::event::Key;
|
||||
|
@ -9,6 +9,7 @@ const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|||
pub struct Editor {
|
||||
should_quit: bool,
|
||||
terminal: Terminal,
|
||||
document: Document,
|
||||
cursor_position: Position,
|
||||
}
|
||||
|
||||
|
@ -23,6 +24,7 @@ impl Default for Editor {
|
|||
Self {
|
||||
should_quit: false,
|
||||
terminal: Terminal::default().expect("Failed to initialize terminal"),
|
||||
document: Document::default(),
|
||||
cursor_position: Position::default(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user