diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ca0eaac2..e5e98909f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * support rewording non-HEAD commits when `commit.gpgsign` is enabled (gpg format only) [[@guerinoni](https://github.com/guerinoni)] ([#2959](https://github.com/gitui-org/gitui/pull/2959)) ### Fixes +* use `Alt+u` to undo a commit in the Vim keybindings so it has a distinct key from file reset (`Shift+U`) ([#2704](https://github.com/gitui-org/gitui/issues/2704)) * crash when opening submodule ([#2895](https://github.com/gitui-org/gitui/issues/2895)) * when staging the last file in a directory, the first item after the directory is no longer skipped [[@Tillerino](https://github.com/Tillerino)] ([#2748](https://github.com/gitui-org/gitui/issues/2748)) * index-out-of-bounds panic when unstaging lines near the end of a diff ([#2953](https://github.com/gitui-org/gitui/issues/2953)) diff --git a/KEY_CONFIG.md b/KEY_CONFIG.md index 658aad11b6..f34fda06ae 100644 --- a/KEY_CONFIG.md +++ b/KEY_CONFIG.md @@ -16,6 +16,7 @@ Create a `key_bindings.ron` file like this: open_help: Some(( code: F(1), modifiers: "")), status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")), + undo_commit: Some(( code: Char('u'), modifiers: "ALT")), ) ``` diff --git a/src/keys/key_list.rs b/src/keys/key_list.rs index 24a9507a49..844ea6cc73 100644 --- a/src/keys/key_list.rs +++ b/src/keys/key_list.rs @@ -261,6 +261,10 @@ mod tests { let patch = ron::de::from_reader(f) .expect("vim style config format incorrect"); keys_list.apply(patch); + assert_ne!( + keys_list.status_reset_item, + keys_list.undo_commit + ); } #[test] diff --git a/vim_style_key_config.ron b/vim_style_key_config.ron index 5f3b30c3aa..0e0570f48d 100644 --- a/vim_style_key_config.ron +++ b/vim_style_key_config.ron @@ -27,6 +27,7 @@ edit_file: Some(( code: Char('I'), modifiers: "SHIFT")), status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")), + undo_commit: Some(( code: Char('u'), modifiers: "ALT")), diff_reset_lines: Some(( code: Char('u'), modifiers: "")), diff_stage_lines: Some(( code: Char('s'), modifiers: "")),