From c31b8587ab1a0cfd6b08457ce7023225f498b868 Mon Sep 17 00:00:00 2001 From: Tibor Prokai Date: Mon, 26 Oct 2026 12:03:09 +0100 Subject: [PATCH 1/2] 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; From 3b04f1d7d15e57977a3c24e3d3ca61d69d738cdf Mon Sep 17 00:00:00 2001 From: Tibor Prokai Date: Fri, 6 Nov 2026 13:12:52 +0100 Subject: [PATCH 2/2] Add preference to bind external diff tool to double click --- src/Resources/Locales/en_US.axaml | 1 + src/ViewModels/Preferences.cs | 7 +++++++ src/Views/CommitChanges.axaml.cs | 3 ++- src/Views/Preferences.axaml | 6 +++++- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 9abb3bdcc9..2e15792421 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -687,6 +687,7 @@ Use fixed tab width in titlebar Use native window frame DIFF/MERGE TOOL + Bind to double click Diff Arguments Available variables: $LOCAL, $REMOTE Merge Arguments diff --git a/src/ViewModels/Preferences.cs b/src/ViewModels/Preferences.cs index 4803ec4296..cf84e88ff9 100644 --- a/src/ViewModels/Preferences.cs +++ b/src/ViewModels/Preferences.cs @@ -384,6 +384,12 @@ public string ShellOrTerminalArgs } } + public bool ExternalMergeToolBindToDoubleClick + { + get => _externalMergeToolBindToDoubleClick; + set => SetProperty(ref _externalMergeToolBindToDoubleClick, value); + } + public int ExternalMergeToolType { get => Native.OS.ExternalMergerType; @@ -846,5 +852,6 @@ private bool RemoveInvalidRepositoriesRecursive(List collection) private string _gitDefaultCloneDir = string.Empty; private int _shellOrTerminalType = -1; + private bool _externalMergeToolBindToDoubleClick = false; } } diff --git a/src/Views/CommitChanges.axaml.cs b/src/Views/CommitChanges.axaml.cs index 2f4230cc57..8d948393ea 100644 --- a/src/Views/CommitChanges.axaml.cs +++ b/src/Views/CommitChanges.axaml.cs @@ -19,7 +19,8 @@ public CommitChanges() private void OnChangeDoubleTapped(object sender, RoutedEventArgs e) { - if (DataContext is ViewModels.CommitDetail vm && + if (ViewModels.Preferences.Instance.ExternalMergeToolBindToDoubleClick && + DataContext is ViewModels.CommitDetail vm && sender is ChangeCollectionView { Selection: { Count: 1, HasFolder: false } selection }) { vm.OpenChangeInMergeTool(selection.Changes[0]); diff --git a/src/Views/Preferences.axaml b/src/Views/Preferences.axaml index 5a19a248f8..da68e4bd9d 100644 --- a/src/Views/Preferences.axaml +++ b/src/Views/Preferences.axaml @@ -586,7 +586,7 @@ - + @@ -672,6 +672,10 @@ + +