some more testing
This commit is contained in:
parent
62e9bd45e5
commit
9a9c14bc0f
13
src/main.rs
13
src/main.rs
@ -5,11 +5,14 @@ mod editor;
|
||||
|
||||
fn main() {
|
||||
let lambda = editor::Editor::new();
|
||||
println!("{}", lambda.buffer.data[0]);
|
||||
let term = terminal::Terminal::new();
|
||||
for _ in [0..1000000000] {
|
||||
println!("{:?}", term);
|
||||
std::thread::sleep(Duration::from_millis(2000));
|
||||
let _term = terminal::Terminal::new();
|
||||
loop {
|
||||
print!("{esc}[2J{esc}[1;1H", esc = 27 as char);
|
||||
for line in lambda.buffer.data {
|
||||
terminal::Terminal::write(format!("{line}"));
|
||||
};
|
||||
std::thread::sleep(Duration::from_millis(3000));
|
||||
break;
|
||||
};
|
||||
terminal::Terminal::exit()
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crossterm::terminal;
|
||||
use crossterm::{execute, ErrorKind};
|
||||
use crossterm::style::Print;
|
||||
use std::io::{stdout, Write};
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -36,4 +37,8 @@ impl Terminal {
|
||||
execute!(stdout(), terminal::LeaveAlternateScreen).unwrap();
|
||||
terminal::disable_raw_mode().unwrap();
|
||||
}
|
||||
|
||||
pub fn write(text: String) {
|
||||
execute!(stdout(), Print(text)).unwrap();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user