From af92bbd9b7e9ba37170f750a95bb6060386ebfc1 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 8 May 2021 09:25:16 +0800 Subject: [PATCH] fix: missing context menu items for staged changes; update DiffTarget when items changed --- src/Views/Widgets/WorkingCopyChanges.xaml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Views/Widgets/WorkingCopyChanges.xaml.cs b/src/Views/Widgets/WorkingCopyChanges.xaml.cs index 99389b2b..4c9cf21a 100644 --- a/src/Views/Widgets/WorkingCopyChanges.xaml.cs +++ b/src/Views/Widgets/WorkingCopyChanges.xaml.cs @@ -177,6 +177,8 @@ namespace SourceGit.Views.Widgets { if (!newSet.ContainsKey(old.Path)) { Changes.RemoveAt(i); RemoveTreeNode(Nodes, old); + if (modeTree.Selected.Contains(old)) modeTree.Selected.Remove(old); + if (DiffTarget == old) DiffTarget = null; continue; } @@ -184,6 +186,8 @@ namespace SourceGit.Views.Widgets { if (cur.Index != old.Index || cur.WorkTree != old.WorkTree) { Changes.RemoveAt(i); RemoveTreeNode(Nodes, old); + if (modeTree.Selected.Contains(old)) modeTree.Selected.Remove(old); + if (DiffTarget == old) DiffTarget = null; continue; } @@ -619,6 +623,10 @@ namespace SourceGit.Views.Widgets { Clipboard.SetText(node.Path); e.Handled = true; }; + + menu.Items.Add(explore); + menu.Items.Add(unstage); + menu.Items.Add(copyPath); } else { var unstage = new MenuItem(); unstage.Header = App.Text("FileCM.UnstageMulti", files.Count);