Fix backspace display issue

This commit is contained in:
Artlef 2020-11-29 20:11:25 +01:00
parent 30aee61cad
commit d167e1c84f

View File

@ -327,7 +327,7 @@ fn start_display_thread(request_recv: Receiver<DisplayMessage>) {
stdout,
"{}{}",
termion::cursor::Left(1),
termion::clear::AfterCursor
termion::clear::UntilNewline
)
.unwrap(),
DisplayMessage::Help => print_help(&mut stdout),
@ -417,11 +417,13 @@ fn start_keyboard_input_thread(
}
}
Event::Key(Key::Backspace) => {
if buffer.len() > 0 {
buffer.pop();
display_sender
.send(DisplayMessage::RemoveLastInput)
.unwrap();
}
}
Event::Key(_) => continue,
Event::Mouse(_) => continue,
Event::Unsupported(_) => continue,