Add Enter as keybinding for staging/unstaging

This commit is contained in:
Hannes Braun 2024-08-28 15:17:07 +02:00
parent a573436b67
commit bb54c14566

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;