Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Baarsgaard authored Oct 1, 2023
2 parents 7d16745 + 47ab3ca commit 9edfd75
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
`None`: Will not be displayed in the list of options.
`Some(score)`: score determines the order of options, higher score, higher on the list of options.
- Implement fuzzy search as default on Select and MultiSelect prompts. [#176](https://github.com/mikaelmello/inquire/pull/176)
- Add new option on Select/MultiSelect prompts to reset selection to the first item on filter input changes. [#176](https://github.com/mikaelmello/inquire/pull/176)
- Add new option on Select/MultiSelect prompts allowing to reset selection to the first item on filter-input changes. [#176](https://github.com/mikaelmello/inquire/pull/176)
- Keybindings Ctrl-p and Ctrl-n added for Up and Down actions

### Fixes

Expand Down
4 changes: 2 additions & 2 deletions inquire/src/prompts/multiselect/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ impl InnerAction for MultiSelectPromptAction {
}

let action = match key {
Key::Up(KeyModifiers::NONE) => Self::MoveUp,
Key::Up(KeyModifiers::NONE) | Key::Char('p', KeyModifiers::CONTROL) => Self::MoveUp,
Key::PageUp => Self::PageUp,
Key::Home => Self::MoveToStart,

Key::Down(KeyModifiers::NONE) => Self::MoveDown,
Key::Down(KeyModifiers::NONE) | Key::Char('n', KeyModifiers::CONTROL) => Self::MoveDown,
Key::PageDown => Self::PageDown,
Key::End => Self::MoveToEnd,

Expand Down
4 changes: 2 additions & 2 deletions inquire/src/prompts/select/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ impl InnerAction for SelectPromptAction {
}

let action = match key {
Key::Up(KeyModifiers::NONE) => Self::MoveUp,
Key::Up(KeyModifiers::NONE) | Key::Char('p', KeyModifiers::CONTROL) => Self::MoveUp,
Key::PageUp => Self::PageUp,
Key::Home => Self::MoveToStart,

Key::Down(KeyModifiers::NONE) => Self::MoveDown,
Key::Down(KeyModifiers::NONE) | Key::Char('n', KeyModifiers::CONTROL) => Self::MoveDown,
Key::PageDown => Self::PageDown,
Key::End => Self::MoveToEnd,

Expand Down
8 changes: 6 additions & 2 deletions inquire/src/prompts/text/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ impl InnerAction for TextPromptAction {

fn from_key(key: Key, _config: &TextConfig) -> Option<Self> {
let action = match key {
Key::Up(KeyModifiers::NONE) => Self::MoveToSuggestionAbove,
Key::Up(KeyModifiers::NONE) | Key::Char('p', KeyModifiers::CONTROL) => {
Self::MoveToSuggestionAbove
}
Key::PageUp => Self::MoveToSuggestionPageUp,

Key::Down(KeyModifiers::NONE) => Self::MoveToSuggestionBelow,
Key::Down(KeyModifiers::NONE) | Key::Char('n', KeyModifiers::CONTROL) => {
Self::MoveToSuggestionBelow
}
Key::PageDown => Self::MoveToSuggestionPageDown,

Key::Tab => Self::UseCurrentSuggestion,
Expand Down

0 comments on commit 9edfd75

Please sign in to comment.