Del implemented
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Justine Pelletreau
2023-02-03 20:10:14 +01:00
parent 4d5cc2fa65
commit b31e3d4be4
2 changed files with 17 additions and 1 deletions

View File

@ -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, &current_pos);
write!(stdout, "{}", mycommand);
write!(stdout, "{}", cursor::Restore);
stdout.flush();
}
},
Key::Backspace => {
if current_pos > 0 {
current_pos -= 1;