diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 0db3cbb2..f6c05526 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -852,6 +852,7 @@ namespace SourceGit.Views { var rs = new Models.TextDiffSelection(); var diff = TextDiff; + endLine = Math.Min(endLine, TextDiff.Lines.Count); if (Content is ViewModels.TwoSideTextDiff twoSides) { var target = isOldSide ? twoSides.Old : twoSides.New; var firstContentLine = -1;