From 6e624797ae5a3d01223257a3be1207a70a19adf4 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 28 Aug 2023 10:17:10 +0800 Subject: [PATCH] optimize: only navigate to commit when user clicked the commit SHA --- src/Views/Blame.xaml | 6 +++++- src/Views/Blame.xaml.cs | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Views/Blame.xaml b/src/Views/Blame.xaml index db12c6db..f54a37a8 100644 --- a/src/Views/Blame.xaml +++ b/src/Views/Blame.xaml @@ -88,7 +88,11 @@ - + + + + + diff --git a/src/Views/Blame.xaml.cs b/src/Views/Blame.xaml.cs index 8d1340e9..2a8c1598 100644 --- a/src/Views/Blame.xaml.cs +++ b/src/Views/Blame.xaml.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; +using System.Windows.Navigation; namespace SourceGit.Views { /// @@ -156,12 +157,15 @@ namespace SourceGit.Views { var r = blame.SelectedItem as Record; if (r == null) return; - Models.Watcher.Get(repo).NavigateTo(r.Line.CommitSHA); - foreach (var one in Records) { one.IsSelected = one.Line.CommitSHA == r.Line.CommitSHA; } } + + private void GotoCommit(object sender, RequestNavigateEventArgs e) { + Models.Watcher.Get(repo).NavigateTo(e.Uri.OriginalString); + e.Handled = true; + } #endregion private string repo = null;