enhance: supports to navigate to target commit while resolving conflicts

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-07 12:22:47 +08:00
parent ca6d41ee60
commit 83f23583be
No known key found for this signature in database
3 changed files with 24 additions and 18 deletions

View file

@ -1,6 +1,7 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.VisualTree;
namespace SourceGit.Views
{
@ -159,5 +160,14 @@ namespace SourceGit.Views
e.Handled = true;
}
private void OnPressedSHA(object sender, PointerPressedEventArgs e)
{
var repoView = this.FindAncestorOfType<Repository>();
if (repoView is { DataContext: ViewModels.Repository repo } && sender is TextBlock text)
repo.NavigateToCommit(text.Text);
e.Handled = true;
}
}
}