Skip to content

Commit 10c55a2

Browse files
committed
Changeset: Explain why number of removals doesn't matter
1 parent 6495b1e commit 10c55a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/static/js/Changeset.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,11 +808,12 @@ class TextLinesMutator {
808808
* Indicates if curLine is already in the splice. This is necessary because the last element in
809809
* curSplice is curLine when this line is currently worked on (e.g. when skipping or inserting).
810810
*
811-
* TODO(doc) why aren't removals considered?
812-
*
813811
* @returns {boolean} true if curLine is in splice
814812
*/
815813
_isCurLineInSplice() {
814+
// The value of `this._curSplice[1]` does not matter when determining the return value because
815+
// `this._curLine` refers to the line number *after* the splice is applied (so after those lines
816+
// are deleted).
816817
return this._curLine - this._curSplice[0] < this._curSplice.length - 2;
817818
}
818819

0 commit comments

Comments
 (0)