Fix backspace display issue
This commit is contained in:
parent
30aee61cad
commit
d167e1c84f
@ -327,7 +327,7 @@ fn start_display_thread(request_recv: Receiver<DisplayMessage>) {
|
|||||||
stdout,
|
stdout,
|
||||||
"{}{}",
|
"{}{}",
|
||||||
termion::cursor::Left(1),
|
termion::cursor::Left(1),
|
||||||
termion::clear::AfterCursor
|
termion::clear::UntilNewline
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
DisplayMessage::Help => print_help(&mut stdout),
|
DisplayMessage::Help => print_help(&mut stdout),
|
||||||
@ -417,11 +417,13 @@ fn start_keyboard_input_thread(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::Key(Key::Backspace) => {
|
Event::Key(Key::Backspace) => {
|
||||||
|
if buffer.len() > 0 {
|
||||||
buffer.pop();
|
buffer.pop();
|
||||||
display_sender
|
display_sender
|
||||||
.send(DisplayMessage::RemoveLastInput)
|
.send(DisplayMessage::RemoveLastInput)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Event::Key(_) => continue,
|
Event::Key(_) => continue,
|
||||||
Event::Mouse(_) => continue,
|
Event::Mouse(_) => continue,
|
||||||
Event::Unsupported(_) => continue,
|
Event::Unsupported(_) => continue,
|
||||||
|
Loading…
Reference in New Issue
Block a user