From 00ccf29b2b9ef56f8840514fba36d68b67e2f719 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 24 Jun 2025 18:15:26 +0800 Subject: [PATCH] fix: `OnNodesSelectionChanged` event should not be disabled while auto-selecting current branch (#1022) Signed-off-by: leo --- src/Views/BranchTree.axaml.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Views/BranchTree.axaml.cs b/src/Views/BranchTree.axaml.cs index 321b48e7..0f97edf5 100644 --- a/src/Views/BranchTree.axaml.cs +++ b/src/Views/BranchTree.axaml.cs @@ -246,16 +246,11 @@ namespace SourceGit.Views if (branch == null) return; - _disableSelectionChangingEvent = true; - var treePath = new List(); FindTreePath(treePath, Nodes, branch.Name, 0); if (treePath.Count == 0) - { - _disableSelectionChangingEvent = false; return; - } var oldRowCount = Rows.Count; var rows = Rows; @@ -276,7 +271,6 @@ namespace SourceGit.Views var target = treePath[treePath.Count - 1]; BranchesPresenter.SelectedItem = target; BranchesPresenter.ScrollIntoView(target); - _disableSelectionChangingEvent = false; if (oldRowCount != rows.Count) RaiseEvent(new RoutedEventArgs(RowsChangedEvent));