From b5000f920f39791ef293972f2ebe217d2abd33a1 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 11 Oct 2024 11:04:27 +0800 Subject: [PATCH] enhance: highlight selected search commits --- src/ViewModels/Histories.cs | 6 +++++- src/Views/Repository.axaml | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index b5a72763..10f4b60a 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -153,7 +153,11 @@ namespace SourceGit.ViewModels else if (commits.Count == 1) { var commit = commits[0] as Models.Commit; - _repo.SearchResultSelectedCommit = commit; + + if (_repo.SearchResultSelectedCommit == null || _repo.SearchResultSelectedCommit.SHA != commit.SHA) + { + _repo.SearchResultSelectedCommit = _repo.SearchedCommits.Find(x => x.SHA == commit.SHA); + } AutoSelectedCommit = commit; NavigationId = _navigationId + 1; diff --git a/src/Views/Repository.axaml b/src/Views/Repository.axaml index 522f9ee3..63c73938 100644 --- a/src/Views/Repository.axaml +++ b/src/Views/Repository.axaml @@ -460,12 +460,6 @@ - -