Skip to content

Commit

Permalink
Change default keybind for reset action
Browse files Browse the repository at this point in the history
I forgot r is already used for the request/response pane. I went with z because it's kinda like undo, which is ctrl-z.
  • Loading branch information
LucasPickering committed Sep 23, 2024
1 parent c97904e commit d7b23be
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- Add `slumber new` subcommand to generate new collection files [#376](https://github.com/LucasPickering/slumber/issues/376)
- Add `default` field to profiles
- When using the CLI, the `--profile` argument can be omitted to use the default profile
- Reset edited recipe values to their default using `r`
- Reset edited recipe values to their default using `z`
- You can [customize the key](https://slumber.lucaspickering.me/book/api/configuration/input_bindings.html) to whatever you want
- Add `selector_mode` field to chains, to control how single vs multiple results from a JSONPath selector are handled
- Previously, if a selector returned multiple results, an error was returned. Now, the result list will be rendered as a JSON array. To return to the previous behavior, set `selector_mode: single` in your chain.
Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Default for InputEngine {
Action::Toggle => KeyCode::Char(' ').into(),
Action::Cancel => KeyCode::Esc.into(),
Action::Edit => KeyCode::Char('e').into(),
Action::Reset => KeyCode::Char('r').into(),
Action::Reset => KeyCode::Char('z').into(),
Action::SelectProfileList => KeyCode::Char('p').into(),
Action::SelectRecipeList => KeyCode::Char('l').into(),
Action::SelectRecipe => KeyCode::Char('c').into(),
Expand Down
6 changes: 3 additions & 3 deletions crates/tui/src/view/component/recipe_pane/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ mod tests {
);

// Reset username
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);

// Edit password
Expand All @@ -359,7 +359,7 @@ mod tests {
);

// Reset password
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);
}

Expand Down Expand Up @@ -423,7 +423,7 @@ mod tests {
);

// Reset token
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().inner().override_value(), None);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/view/component/recipe_pane/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ mod tests {
);

// Reset edited state
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
assert_eq!(component.data().override_value(), None);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/tui/src/view/component/recipe_pane/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ mod tests {
);

// Reset edited state
component.send_key(KeyCode::Char('r')).assert_empty();
component.send_key(KeyCode::Char('z')).assert_empty();
let selected_row =
component.data().inner().select.data().selected().unwrap();
assert!(!selected_row.value.is_overridden());
Expand Down

0 comments on commit d7b23be

Please sign in to comment.