fix tracking of textLength and lineLength fields, which were previously buggy in only one delete branch; the current commit fixes that branch and verifies the tests pass
This commit is contained in:
@@ -1584,9 +1584,16 @@ struct
|
|||||||
else
|
else
|
||||||
Vector.fromList []
|
Vector.fromList []
|
||||||
|
|
||||||
val newTextLength = String.size sub1 + String.size sub1
|
val newNodeTextLength = String.size sub1 + String.size sub2
|
||||||
val newLineLength =
|
val textLengthDifference =
|
||||||
|
oldNodeTextLength - newNodeTextLength
|
||||||
|
val newTextLength = textLength - textLengthDifference
|
||||||
|
|
||||||
|
val newNodeLineLength =
|
||||||
Vector.length sub1Lines + Vector.length sub2Lines
|
Vector.length sub1Lines + Vector.length sub2Lines
|
||||||
|
val lineLengthDifference =
|
||||||
|
oldNodeLineLength - newNodeLineLength
|
||||||
|
val newLineLength = lineLength - lineLengthDifference
|
||||||
in
|
in
|
||||||
{ idx = curIdx + String.size sub1
|
{ idx = curIdx + String.size sub1
|
||||||
, textLength = newTextLength
|
, textLength = newTextLength
|
||||||
|
|||||||
Reference in New Issue
Block a user