Skip to content

Commit

Permalink
Merge pull request #70 from Julien-cpsn/69-validate-should-be-confirm
Browse files Browse the repository at this point in the history
Changed "Validate" to "Confirm" to avoid the English language police
  • Loading branch information
Julien-cpsn authored May 7, 2024
2 parents 2c82866 + ec5bb3c commit 2305ad4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion key_bindings_templates/default_key_bindings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ display_help = "Ctrl-h" # Take care to not overlap other inputs, the help can be
# Collection name, request name, URL, Header, Query param, Basic Auth, Bearer Token
[keybindings.generic.text_inputs.text_input]
cancel = "Esc"
validate = "Enter"
confirm = "Enter"

delete_backward = "Delete"
delete_forward = "Backspace"
Expand Down
2 changes: 1 addition & 1 deletion key_bindings_templates/vim_key_bindings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ display_help = "Shift-h" # Take care to not overlap other inputs, the help can b
# Collection name, request name, URL, Header, Query param, Basic Auth, Bearer Token
[keybindings.generic.text_inputs.text_input]
cancel = "Esc"
validate = "Enter"
confirm = "Enter"

delete_backward = "Delete"
delete_forward = "Backspace"
Expand Down
26 changes: 13 additions & 13 deletions src/app/app_states.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ impl AppState {
],
CreatingNewCollection => vec![
GoBackToMainMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
CreateNewCollection(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
CreateNewCollection(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

CreatingCollectionDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
CreatingCollectionDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -212,7 +212,7 @@ impl AppState {
],
CreatingNewRequest => vec![
GoBackToMainMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
CreateNewRequest(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
CreateNewRequest(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

CreatingRequestDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
CreatingRequestDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand Down Expand Up @@ -243,7 +243,7 @@ impl AppState {
],
RenamingCollection => vec![
GoBackToMainMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
RenameCollection(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
RenameCollection(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

RenamingCollectionDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
RenamingCollectionDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -253,7 +253,7 @@ impl AppState {
],
RenamingRequest => vec![
GoBackToMainMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
RenameRequest(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
RenameRequest(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

RenamingRequestDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
RenamingRequestDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand Down Expand Up @@ -380,7 +380,7 @@ impl AppState {
},
EditingRequestUrl => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestUrl(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestUrl(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestUrlDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestUrlDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -390,7 +390,7 @@ impl AppState {
],
EditingRequestParam => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestQueryParam(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestQueryParam(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestQueryParamDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestQueryParamDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -400,7 +400,7 @@ impl AppState {
],
EditingRequestAuthUsername => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestAuthUsername(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestAuthUsername(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestAuthUsernameDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestAuthUsernameDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -410,7 +410,7 @@ impl AppState {
],
EditingRequestAuthPassword => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestAuthPassword(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestAuthPassword(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestAuthPasswordDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestAuthPasswordDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -420,7 +420,7 @@ impl AppState {
],
EditingRequestAuthBearerToken => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestAuthBearerToken(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestAuthBearerToken(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestAuthBearerTokenDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestAuthBearerTokenDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -430,7 +430,7 @@ impl AppState {
],
EditingRequestHeader => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestHeader(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestHeader(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestHeaderDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestHeaderDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -440,7 +440,7 @@ impl AppState {
],
EditingRequestBodyTable => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestBodyTable(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestBodyTable(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestBodyTableDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestBodyTableDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand All @@ -450,7 +450,7 @@ impl AppState {
],
EditingRequestBodyFile => vec![
GoBackToRequestMenu(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.cancel], "Cancel", Some("Cancel"))),
ModifyRequestBodyFile(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.validate], "Validate", Some("Validate"))),
ModifyRequestBodyFile(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.confirm], "Confirm", Some("Confirm"))),

EditingRequestBodyFileDeleteCharBackward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_backward], "Delete char backward", Some("Delete"))),
EditingRequestBodyFileDeleteCharForward(EventKeyBinding::new(vec![key_bindings.generic.text_inputs.text_input.delete_forward], "Delete char forward", Some("Backspace"))),
Expand Down Expand Up @@ -546,7 +546,7 @@ impl AppState {
RequestSettingsMoveDown(EventKeyBinding::new(vec![key_bindings.generic.navigation.move_cursor_down], "Move down", Some("Down"))),
RequestSettingsToggleSetting(EventKeyBinding::new(vec![key_bindings.generic.navigation.move_cursor_left, key_bindings.generic.navigation.move_cursor_right], "Toggle setting", Some("Toggle"))),

ModifyRequestSettings(EventKeyBinding::new(vec![key_bindings.generic.navigation.select], "Validate", Some("Validate"))),
ModifyRequestSettings(EventKeyBinding::new(vec![key_bindings.generic.navigation.select], "Confirm", Some("Confirm"))),
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/files/key_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ nest! {
/// Collection name, request name, URL, Header, Query param, Basic Auth, Bearer Token
pub text_input: #[derive(Copy, Clone, Deserialize)] pub struct TextInput {
pub cancel: KeyCombination,
pub validate: KeyCombination,
pub confirm: KeyCombination,

pub delete_backward: KeyCombination,
pub delete_forward: KeyCombination,
Expand Down Expand Up @@ -170,7 +170,7 @@ impl Default for KeyBindings {
text_inputs: TexInputs {
text_input: TextInput {
cancel: key!(esc),
validate: key!(enter),
confirm: key!(enter),

delete_backward: key!(delete),
delete_forward: key!(backspace),
Expand Down

0 comments on commit 2305ad4

Please sign in to comment.