clear status once per loop

pull/6/head
dvkt 4 years ago
parent 38f09f7893
commit f9428256a8

@ -89,6 +89,7 @@ impl UI {
pub fn update(&mut self) {
let action = self.process_page_input();
self.status.clear();
if let Err(e) = self.process_action(action) {
self.set_status(format!(
"{}{}{}",
@ -392,14 +393,6 @@ impl UI {
}
fn process_action(&mut self, action: Action) -> Result<()> {
// track if the status line was cleared in this update cycle
let cleared = if !self.status.is_empty() {
self.status.clear();
true
} else {
false
};
match action {
Action::List(actions) => {
for action in actions {
@ -407,9 +400,7 @@ impl UI {
}
}
Action::Keypress(Key::Ctrl('c')) => {
if !cleared {
self.running = false
}
self.status = "\x1b[90m(Use q to quit)\x1b[0m".into()
}
Action::Keypress(Key::Esc) => {}
Action::Error(e) => return Err(error!(e)),

Loading…
Cancel
Save