stable
Clone or download
Read-only
request #29968 scroll-to-comment js error when comment is on last line
File lines offsets start at 1, but codemirror lines start at 0. When we ask codemirror to scroll to a given line, we hence should subtract 1 to the given line number, or it will lead to a "There is no line <number> in the document." error when the comment is on the last line of the file. How to test: - In a pull request, go to the changes, and add a comment on the last line of a file - Go back to the overview tab - Click the link displayed in the header of the comment inside the timeline --> The comment is scrolled into view. --> There is no error in the console Change-Id: I9dd5e5a9e4ab39fe88910fc1d435e6132bda02e1
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-diff-comment-scroller.test.ts | +3 | −3 | Go to diff View file |
M | plugins/pullrequest/scripts/pullrequests-app/src/app/file-diff/diff-modes/file-diff-comment-scroller.ts | +1 | −1 | Go to diff View file |