feat(merge): add accept-both control to the 3-pane conflict gutter

The between-pane gutter only offered single-side replace (accept ours / accept
theirs). Add an 'accept both' (⊕) control under the ours chevron that drops
ours-then-theirs into the result region, so a conflict can be combined in one
click instead of picking one side and hand-adding the other. en/de keys added.
This commit is contained in:
Mika Kuns
2026-06-19 10:43:35 +02:00
parent 869dd25a23
commit 18479c023e
3 changed files with 8 additions and 0 deletions

View File

@@ -408,6 +408,7 @@
"nextConflict": "Nächster Konflikt (F8)", "nextConflict": "Nächster Konflikt (F8)",
"acceptOurs": "Ours ins Ergebnis übernehmen", "acceptOurs": "Ours ins Ergebnis übernehmen",
"acceptTheirs": "Theirs ins Ergebnis übernehmen", "acceptTheirs": "Theirs ins Ergebnis übernehmen",
"acceptBoth": "Beide übernehmen (ours, dann theirs)",
"continue": "Lösen & fortfahren", "continue": "Lösen & fortfahren",
"abort": "Merge abbrechen" "abort": "Merge abbrechen"
}, },

View File

@@ -408,6 +408,7 @@
"nextConflict": "Next conflict (F8)", "nextConflict": "Next conflict (F8)",
"acceptOurs": "Accept ours into result", "acceptOurs": "Accept ours into result",
"acceptTheirs": "Accept theirs into result", "acceptTheirs": "Accept theirs into result",
"acceptBoth": "Accept both (ours, then theirs)",
"continue": "Resolve & continue", "continue": "Resolve & continue",
"abort": "Abort merge" "abort": "Abort merge"
}, },

View File

@@ -216,6 +216,7 @@ public partial class ConflictResolverView : Window
private void AcceptOurs(MergeConflictBlock block) => AcceptInto(block, block.Ours); private void AcceptOurs(MergeConflictBlock block) => AcceptInto(block, block.Ours);
private void AcceptTheirs(MergeConflictBlock block) => AcceptInto(block, block.Theirs); private void AcceptTheirs(MergeConflictBlock block) => AcceptInto(block, block.Theirs);
private void AcceptBoth(MergeConflictBlock block) => AcceptInto(block, block.Ours + block.Theirs);
private void AcceptInto(MergeConflictBlock block, string text) private void AcceptInto(MergeConflictBlock block, string text)
{ {
@@ -274,8 +275,13 @@ public partial class ConflictResolverView : Window
var capturedBlock = block; var capturedBlock = block;
if (tv.TranslatePoint(new Point(0, y), LeftGutter) is { } pl && if (tv.TranslatePoint(new Point(0, y), LeftGutter) is { } pl &&
pl.Y > -24 && pl.Y < LeftGutter.Bounds.Height + 24) pl.Y > -24 && pl.Y < LeftGutter.Bounds.Height + 24)
{
AddAcceptButton(LeftGutter, pl.Y, "", () => AcceptOurs(capturedBlock), AddAcceptButton(LeftGutter, pl.Y, "", () => AcceptOurs(capturedBlock),
Tr("conflictResolver.acceptOurs")); Tr("conflictResolver.acceptOurs"));
// "Accept both" sits just under the ours chevron: ours text then theirs text.
AddAcceptButton(LeftGutter, pl.Y + 21, "⊕", () => AcceptBoth(capturedBlock),
Tr("conflictResolver.acceptBoth"));
}
if (tv.TranslatePoint(new Point(0, y), RightGutter) is { } pr && if (tv.TranslatePoint(new Point(0, y), RightGutter) is { } pr &&
pr.Y > -24 && pr.Y < RightGutter.Bounds.Height + 24) pr.Y > -24 && pr.Y < RightGutter.Bounds.Height + 24)