From 4d6ecd2396a77169f739d8bdcb28ed32ecac912b Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 29 Sep 2024 09:20:40 +0800 Subject: [PATCH] fix: can not select the last line in blame (#523) --- src/Views/Blame.axaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Views/Blame.axaml.cs b/src/Views/Blame.axaml.cs index db4f8437..85af8f5e 100644 --- a/src/Views/Blame.axaml.cs +++ b/src/Views/Blame.axaml.cs @@ -158,7 +158,7 @@ namespace SourceGit.Views continue; var lineNumber = line.FirstDocumentLine.LineNumber; - if (lineNumber >= _editor.BlameData.LineInfos.Count) + if (lineNumber > _editor.BlameData.LineInfos.Count) break; var info = _editor.BlameData.LineInfos[lineNumber - 1]; @@ -199,7 +199,7 @@ namespace SourceGit.Views continue; var lineNumber = line.FirstDocumentLine.LineNumber; - if (lineNumber >= _editor.BlameData.LineInfos.Count) + if (lineNumber > _editor.BlameData.LineInfos.Count) break; var info = _editor.BlameData.LineInfos[lineNumber - 1]; @@ -303,7 +303,7 @@ namespace SourceGit.Views continue; var lineNumber = line.FirstDocumentLine.LineNumber; - if (lineNumber >= BlameData.LineInfos.Count) + if (lineNumber > BlameData.LineInfos.Count) break; var info = BlameData.LineInfos[lineNumber - 1]; @@ -362,7 +362,7 @@ namespace SourceGit.Views return; var caret = TextArea.Caret; - if (caret == null || caret.Line >= BlameData.LineInfos.Count) + if (caret == null || caret.Line > BlameData.LineInfos.Count) return; _highlight = BlameData.LineInfos[caret.Line - 1].CommitSHA;