From 10fba08e430f6f67d6c1bca7abbf9338a546b9a4 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 11 Feb 2025 11:07:33 +0800 Subject: [PATCH] code_review: PR #949 Signed-off-by: leo --- src/Views/TextDiffView.axaml.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index cc8fcfe5..28fe81a8 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -973,13 +973,9 @@ namespace SourceGit.Views var startPosition = selection.StartPosition; var endPosition = selection.EndPosition; - - if (startPosition.Line > endPosition.Line - || startPosition.Line == endPosition.Line && startPosition.Column > endPosition.Column) - { - // swap start and end + + if (startPosition.Location > endPosition.Location) (startPosition, endPosition) = (endPosition, startPosition); - } var startIdx = Math.Min(startPosition.Line - 1, lines.Count - 1); var endIdx = Math.Min(endPosition.Line - 1, lines.Count - 1);