mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
enhance: supports using Delete
or Backspace
to discard selected changes (#423)
This commit is contained in:
parent
9c40b76577
commit
c22ba75780
5 changed files with 27 additions and 10 deletions
|
@ -62,10 +62,21 @@ namespace SourceGit.Views
|
|||
|
||||
private void OnUnstagedKeyDown(object _, KeyEventArgs e)
|
||||
{
|
||||
if (DataContext is ViewModels.WorkingCopy vm && e.Key is Key.Space or Key.Enter)
|
||||
if (DataContext is ViewModels.WorkingCopy vm)
|
||||
{
|
||||
vm.StageSelected();
|
||||
e.Handled = true;
|
||||
if (e.Key is Key.Space or Key.Enter)
|
||||
{
|
||||
vm.StageSelected();
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Key is Key.Delete or Key.Back && vm.SelectedUnstaged is { Count: > 0 } selected)
|
||||
{
|
||||
vm.Discard(selected);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue