diff --git a/src/lib.rs b/src/lib.rs index 53ca509..2729126 100644 --- a/src/lib.rs +++ b/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; diff --git a/src/shell/autocomplete.rs b/src/shell/autocomplete.rs index d2e6376..29cdf73 100644 --- a/src/shell/autocomplete.rs +++ b/src/shell/autocomplete.rs @@ -107,7 +107,7 @@ impl Search { fn discriminate_search_type(input: &String) -> SearchType { let tamere = input.clone(); let mut a = tamere.split(" ").collect::>(); - let y = String::from(a.pop().unwrap()); + let _y = String::from(a.pop().unwrap()); let mut x = String::from(a.join(" ").trim()); if x.len() > 0 { x.push_str(" ")