This commit is contained in:
16
src/lib.rs
16
src/lib.rs
@ -349,6 +349,22 @@ pub mod shell {
|
||||
|
||||
},
|
||||
|
||||
Key::Delete => {
|
||||
if current_pos >= 0 && current_pos < max_pos {
|
||||
mycommand.remove(current_pos);
|
||||
if current_pos > 0 {
|
||||
current_pos -= 1;
|
||||
write!(stdout, "{}", cursor::Left(1));
|
||||
}
|
||||
max_pos -= 1;
|
||||
write!(stdout, "{}", cursor::Save);
|
||||
clear_line(&max_pos, ¤t_pos);
|
||||
write!(stdout, "{}", mycommand);
|
||||
write!(stdout, "{}", cursor::Restore);
|
||||
stdout.flush();
|
||||
}
|
||||
},
|
||||
|
||||
Key::Backspace => {
|
||||
if current_pos > 0 {
|
||||
current_pos -= 1;
|
||||
|
||||
Reference in New Issue
Block a user