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() {
|
fn main() {
|
||||||
let lambda = editor::Editor::new();
|
let lambda = editor::Editor::new();
|
||||||
println!("{}", lambda.buffer.data[0]);
|
let _term = terminal::Terminal::new();
|
||||||
let term = terminal::Terminal::new();
|
loop {
|
||||||
for _ in [0..1000000000] {
|
print!("{esc}[2J{esc}[1;1H", esc = 27 as char);
|
||||||
println!("{:?}", term);
|
for line in lambda.buffer.data {
|
||||||
std::thread::sleep(Duration::from_millis(2000));
|
terminal::Terminal::write(format!("{line}"));
|
||||||
|
};
|
||||||
|
std::thread::sleep(Duration::from_millis(3000));
|
||||||
|
break;
|
||||||
};
|
};
|
||||||
terminal::Terminal::exit()
|
terminal::Terminal::exit()
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use crossterm::terminal;
|
use crossterm::terminal;
|
||||||
use crossterm::{execute, ErrorKind};
|
use crossterm::{execute, ErrorKind};
|
||||||
|
use crossterm::style::Print;
|
||||||
use std::io::{stdout, Write};
|
use std::io::{stdout, Write};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -36,4 +37,8 @@ impl Terminal {
|
|||||||
execute!(stdout(), terminal::LeaveAlternateScreen).unwrap();
|
execute!(stdout(), terminal::LeaveAlternateScreen).unwrap();
|
||||||
terminal::disable_raw_mode().unwrap();
|
terminal::disable_raw_mode().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn write(text: String) {
|
||||||
|
execute!(stdout(), Print(text)).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user