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 => {
|
Key::Backspace => {
|
||||||
if current_pos > 0 {
|
if current_pos > 0 {
|
||||||
current_pos -= 1;
|
current_pos -= 1;
|
||||||
|
@ -107,7 +107,7 @@ impl Search {
|
|||||||
fn discriminate_search_type(input: &String) -> SearchType {
|
fn discriminate_search_type(input: &String) -> SearchType {
|
||||||
let tamere = input.clone();
|
let tamere = input.clone();
|
||||||
let mut a = tamere.split(" ").collect::<Vec<&str>>();
|
let mut a = tamere.split(" ").collect::<Vec<&str>>();
|
||||||
let y = String::from(a.pop().unwrap());
|
let _y = String::from(a.pop().unwrap());
|
||||||
let mut x = String::from(a.join(" ").trim());
|
let mut x = String::from(a.join(" ").trim());
|
||||||
if x.len() > 0 {
|
if x.len() > 0 {
|
||||||
x.push_str(" ")
|
x.push_str(" ")
|
||||||
|
Reference in New Issue
Block a user