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

Commit

Permalink
Merge pull request #2112 from github/add-comment-missing
Browse files Browse the repository at this point in the history
Fixing the calculation to determine if a line is available for comment
  • Loading branch information
StanleyGoldman authored Dec 6, 2018
2 parents d5780f2 + 495c53c commit c5ef0d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ namespace GitHub.Services
public interface IInlineCommentPeekService
{
/// <summary>
/// Gets the line number for a peek session tracking point.
/// Gets the 0-based line number for a peek session tracking point.
/// </summary>
/// <param name="session">The peek session.</param>
/// <param name="point">The peek session tracking point</param>
/// <returns>
/// A tuple containing the line number and whether the line number represents a line in the
/// A tuple containing the 0-based line number and whether the line number represents a line in the
/// left hand side of a diff view.
/// </returns>
Tuple<int, bool> GetLineNumber(IPeekSession session, ITrackingPoint point);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ async Task UpdateThread()

AvailableForComment =
file.Diff.Any(chunk => chunk.Lines
.Any(line => line.NewLineNumber == lineNumber));
.Any(line => line.NewLineNumber - 1 == lineNumber));

var thread = file.InlineCommentThreads?.FirstOrDefault(x =>
x.LineNumber == lineNumber &&
Expand Down

0 comments on commit c5ef0d8

Please sign in to comment.