some more testing

This commit is contained in:
Maddie H 2022-11-04 07:19:20 +00:00
parent 62e9bd45e5
commit 9a9c14bc0f
No known key found for this signature in database
GPG Key ID: 64FAA9959751687D
2 changed files with 13 additions and 5 deletions

View File

@ -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()
}

View File

@ -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();
}
}