From c31b8587ab1a0cfd6b08457ce7023225f498b868 Mon Sep 17 00:00:00 2001 From: Tibor Prokai Date: Mon, 26 Oct 2026 12:03:09 +0100 Subject: [PATCH] Open changed files in external merge tool on double-click --- src/Views/CommitChanges.axaml | 1 + src/Views/CommitChanges.axaml.cs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Views/CommitChanges.axaml b/src/Views/CommitChanges.axaml index d14b14eca4..19c6d76c3f 100644 --- a/src/Views/CommitChanges.axaml +++ b/src/Views/CommitChanges.axaml @@ -58,6 +58,7 @@ EnableCompactFolders="{Binding Source={x:Static vm:Preferences.Instance}, Path=EnableCompactFoldersInChangesTree}" Changes="{Binding VisibleChanges, Mode=OneWay}" Selection="{Binding ChangeSelection, Mode=TwoWay}" + ChangeDoubleTapped="OnChangeDoubleTapped" ContextRequested="OnChangeContextRequested" KeyDown="OnChangeCollectionViewKeyDown"/> diff --git a/src/Views/CommitChanges.axaml.cs b/src/Views/CommitChanges.axaml.cs index 5ff13d5938..2f4230cc57 100644 --- a/src/Views/CommitChanges.axaml.cs +++ b/src/Views/CommitChanges.axaml.cs @@ -4,6 +4,7 @@ using System.Text; using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Interactivity; using Avalonia.Platform.Storage; using Avalonia.VisualTree; @@ -16,6 +17,16 @@ public CommitChanges() InitializeComponent(); } + private void OnChangeDoubleTapped(object sender, RoutedEventArgs e) + { + if (DataContext is ViewModels.CommitDetail vm && + sender is ChangeCollectionView { Selection: { Count: 1, HasFolder: false } selection }) + { + vm.OpenChangeInMergeTool(selection.Changes[0]); + e.Handled = true; + } + } + private void OnChangeContextRequested(object sender, ContextRequestedEventArgs e) { e.Handled = true;