mirror of
https://github.com/msfjarvis/text-editor.git
synced 2024-06-03 04:18:57 +05:30
feat(editor): add terminal to Editor
struct
This commit is contained in:
parent
d2bb3694f8
commit
a9c540525d
|
@ -1,10 +1,20 @@
|
|||
use crate::terminal::Terminal;
|
||||
use std::io::{self, stdout, Write};
|
||||
use std::result::Result;
|
||||
use termion::{event::Key, input::TermRead, raw::IntoRawMode};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Editor {
|
||||
should_quit: bool,
|
||||
terminal: Terminal,
|
||||
}
|
||||
|
||||
impl Default for Editor {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
should_quit: false,
|
||||
terminal: Terminal::default().expect("Failed to initialize terminal"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Editor {
|
||||
|
|
Loading…
Reference in New Issue
Block a user