Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit c5ef0d8

Browse files
Merge pull request #2112 from github/add-comment-missing
Fixing the calculation to determine if a line is available for comment
2 parents d5780f2 + 495c53c commit c5ef0d8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/GitHub.Exports.Reactive/Services/IInlineCommentPeekService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ namespace GitHub.Services
1212
public interface IInlineCommentPeekService
1313
{
1414
/// <summary>
15-
/// Gets the line number for a peek session tracking point.
15+
/// Gets the 0-based line number for a peek session tracking point.
1616
/// </summary>
1717
/// <param name="session">The peek session.</param>
1818
/// <param name="point">The peek session tracking point</param>
1919
/// <returns>
20-
/// A tuple containing the line number and whether the line number represents a line in the
20+
/// A tuple containing the 0-based line number and whether the line number represents a line in the
2121
/// left hand side of a diff view.
2222
/// </returns>
2323
Tuple<int, bool> GetLineNumber(IPeekSession session, ITrackingPoint point);

src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async Task UpdateThread()
196196

197197
AvailableForComment =
198198
file.Diff.Any(chunk => chunk.Lines
199-
.Any(line => line.NewLineNumber == lineNumber));
199+
.Any(line => line.NewLineNumber - 1 == lineNumber));
200200

201201
var thread = file.InlineCommentThreads?.FirstOrDefault(x =>
202202
x.LineNumber == lineNumber &&

0 commit comments

Comments
 (0)