Action::Draw

pull/6/head
dvkt 4 years ago
parent cf5796be5b
commit 2452e2e856

@ -413,6 +413,11 @@ impl UI {
Action::Keypress(Key::Esc) => {}
Action::Error(e) => return Err(error!(e)),
Action::Redraw => self.dirty = true,
Action::Draw(s) => {
let mut out = self.out.borrow_mut();
out.write_all(s.as_ref());
out.flush();
}
Action::Open(title, url) => self.open(&title, &url)?,
Action::Prompt(query, fun) => {
if let Some(response) = self.prompt(&query) {

@ -5,6 +5,7 @@ pub enum Action {
Open(String, String), // open(title, url)
Keypress(Key), // unknown keypress
Redraw, // redraw everything
Draw(String), // draw something on screen
Prompt(String, Box<dyn FnOnce(String) -> Action>), // query string, callback on success
Error(String), // error message
}

Loading…
Cancel
Save