mirror of
https://github.com/xvxx/phetch
synced 2024-11-05 00:00:58 +00:00
ctrl-c/esc just cancels, doesnt clear
This commit is contained in:
parent
5bec1c274a
commit
a5d9c1c93e
20
src/ui.rs
20
src/ui.rs
@ -377,18 +377,14 @@ impl UI {
|
||||
}
|
||||
Key::Char(c) => input.push(c),
|
||||
Key::Esc | Key::Ctrl('c') => {
|
||||
if input.is_empty() {
|
||||
write!(
|
||||
out,
|
||||
"{}{}",
|
||||
termion::clear::CurrentLine,
|
||||
termion::cursor::Hide
|
||||
);
|
||||
out.flush();
|
||||
return None;
|
||||
} else {
|
||||
input.clear();
|
||||
}
|
||||
write!(
|
||||
out,
|
||||
"{}{}",
|
||||
termion::clear::CurrentLine,
|
||||
termion::cursor::Hide
|
||||
);
|
||||
out.flush();
|
||||
return None;
|
||||
}
|
||||
Key::Backspace | Key::Delete => {
|
||||
input.pop();
|
||||
|
Loading…
Reference in New Issue
Block a user