From 495c53cabf41e032e5778262f9039ed5edf08c1d Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Thu, 6 Dec 2018 13:01:31 -0500 Subject: [PATCH] Fixing the calculation to determine if a line is available for comment --- .../Services/IInlineCommentPeekService.cs | 4 ++-- .../ViewModels/InlineCommentPeekViewModel.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GitHub.Exports.Reactive/Services/IInlineCommentPeekService.cs b/src/GitHub.Exports.Reactive/Services/IInlineCommentPeekService.cs index 219f657241..357ba17b84 100644 --- a/src/GitHub.Exports.Reactive/Services/IInlineCommentPeekService.cs +++ b/src/GitHub.Exports.Reactive/Services/IInlineCommentPeekService.cs @@ -12,12 +12,12 @@ namespace GitHub.Services public interface IInlineCommentPeekService { /// - /// Gets the line number for a peek session tracking point. + /// Gets the 0-based line number for a peek session tracking point. /// /// The peek session. /// The peek session tracking point /// - /// 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. /// Tuple GetLineNumber(IPeekSession session, ITrackingPoint point); diff --git a/src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs b/src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs index 50431ece39..4ff479ce9e 100644 --- a/src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs +++ b/src/GitHub.InlineReviews/ViewModels/InlineCommentPeekViewModel.cs @@ -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 &&