diff --git a/Cargo.toml b/Cargo.toml index d91f1784..f861241e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dialoguer" description = "A command line prompting library." -version = "0.9.0" +version = "0.10.0" edition = "2018" authors = [ "Armin Ronacher ", diff --git a/src/prompts/fuzzy_select.rs b/src/prompts/fuzzy_select.rs index 62e7c944..d7cc67cc 100644 --- a/src/prompts/fuzzy_select.rs +++ b/src/prompts/fuzzy_select.rs @@ -174,7 +174,7 @@ impl FuzzySelect<'_> { term.show_cursor()?; return Ok(None); } - Key::ArrowUp if filtered_list.len() > 0 => { + Key::ArrowUp | Key::BackTab if filtered_list.len() > 0 => { if sel == !0 { sel = filtered_list.len() - 1; } else { @@ -183,7 +183,7 @@ impl FuzzySelect<'_> { } term.flush()?; } - Key::ArrowDown if filtered_list.len() > 0 => { + Key::ArrowDown | Key::Tab if filtered_list.len() > 0 => { if sel == !0 { sel = 0; } else { diff --git a/src/prompts/multi_select.rs b/src/prompts/multi_select.rs index 015e6716..e143c12a 100644 --- a/src/prompts/multi_select.rs +++ b/src/prompts/multi_select.rs @@ -221,14 +221,14 @@ impl MultiSelect<'_> { term.flush()?; match term.read_key()? { - Key::ArrowDown | Key::Char('j') => { + Key::ArrowDown | Key::Tab | Key::Char('j') => { if sel == !0 { sel = 0; } else { sel = (sel as u64 + 1).rem(self.items.len() as u64) as usize; } } - Key::ArrowUp | Key::Char('k') => { + Key::ArrowUp | Key::BackTab | Key::Char('k') => { if sel == !0 { sel = self.items.len() - 1; } else { diff --git a/src/prompts/select.rs b/src/prompts/select.rs index 2713ef80..0bb1c0b0 100644 --- a/src/prompts/select.rs +++ b/src/prompts/select.rs @@ -256,7 +256,7 @@ impl Select<'_> { term.flush()?; match term.read_key()? { - Key::ArrowDown | Key::Char('j') => { + Key::ArrowDown | Key::Tab | Key::Char('j') => { if sel == !0 { sel = 0; } else { @@ -275,7 +275,7 @@ impl Select<'_> { return Ok(None); } } - Key::ArrowUp | Key::Char('k') => { + Key::ArrowUp | Key::BackTab | Key::Char('k') => { if sel == !0 { sel = self.items.len() - 1; } else { diff --git a/src/prompts/sort.rs b/src/prompts/sort.rs index 4d0b50be..19fef5de 100644 --- a/src/prompts/sort.rs +++ b/src/prompts/sort.rs @@ -188,7 +188,7 @@ impl Sort<'_> { term.flush()?; match term.read_key()? { - Key::ArrowDown | Key::Char('j') => { + Key::ArrowDown | Key::Tab | Key::Char('j') => { let old_sel = sel; if sel == !0 { @@ -201,7 +201,7 @@ impl Sort<'_> { order.swap(old_sel, sel); } } - Key::ArrowUp | Key::Char('k') => { + Key::ArrowUp | Key::BackTab | Key::Char('k') => { let old_sel = sel; if sel == !0 {