From d5cc3c3fa2190348a82c7901d228e30814375d99 Mon Sep 17 00:00:00 2001 From: Jai <814683@qq.com> Date: Tue, 6 Jul 2021 12:45:35 +0800 Subject: [PATCH] feature: add the shortcut SPACE to stage/unstage the selected file --- src/Views/Widgets/WorkingCopyChanges.xaml | 3 +++ src/Views/Widgets/WorkingCopyChanges.xaml.cs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/Views/Widgets/WorkingCopyChanges.xaml b/src/Views/Widgets/WorkingCopyChanges.xaml index 799941c5..a3a7f131 100644 --- a/src/Views/Widgets/WorkingCopyChanges.xaml +++ b/src/Views/Widgets/WorkingCopyChanges.xaml @@ -28,14 +28,17 @@ Visibility="Visible"> + + + diff --git a/src/Views/Widgets/WorkingCopyChanges.xaml.cs b/src/Views/Widgets/WorkingCopyChanges.xaml.cs index 11daaf1e..936fcfb0 100644 --- a/src/Views/Widgets/WorkingCopyChanges.xaml.cs +++ b/src/Views/Widgets/WorkingCopyChanges.xaml.cs @@ -689,6 +689,14 @@ namespace SourceGit.Views.Widgets { private void SelectWholeTree(object sender, ExecutedRoutedEventArgs e) { modeTree.SelectAll(); } + + private void StageChange(object sender, ExecutedRoutedEventArgs e) { + if (!IsUnstaged) { + UnstageSelected(); + } else { + StageSelected(); + } + } private void OnTreeSelectionChanged(object sender, RoutedEventArgs e) { if (Mode != Models.Change.DisplayMode.Tree) return;