Merge pull request #422 from hannesbraun/staging-with-enter

Add Enter as keybinding for staging/unstaging
This commit is contained in:
leo 2024-08-28 21:54:49 +08:00 committed by GitHub
commit 69b9d62e57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,7 @@ namespace SourceGit.Views
private void OnUnstagedKeyDown(object _, KeyEventArgs e) private void OnUnstagedKeyDown(object _, KeyEventArgs e)
{ {
if (DataContext is ViewModels.WorkingCopy vm && e.Key == Key.Space) if (DataContext is ViewModels.WorkingCopy vm && e.Key is Key.Space or Key.Enter)
{ {
vm.StageSelected(); vm.StageSelected();
e.Handled = true; e.Handled = true;
@ -71,7 +71,7 @@ namespace SourceGit.Views
private void OnStagedKeyDown(object _, KeyEventArgs e) private void OnStagedKeyDown(object _, KeyEventArgs e)
{ {
if (DataContext is ViewModels.WorkingCopy vm && e.Key == Key.Space) if (DataContext is ViewModels.WorkingCopy vm && e.Key is Key.Space or Key.Enter)
{ {
vm.UnstageSelected(); vm.UnstageSelected();
e.Handled = true; e.Handled = true;