add deletion to compare-testing (deletion does not work properly yet, as expected)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
structure CompareToRope =
|
structure CompareToRope =
|
||||||
struct
|
struct
|
||||||
fun compareTxns arr =
|
fun compareTxns arr =
|
||||||
Vector.foldli
|
Vector.foldli
|
||||||
(fn (idx, (pos, delNum, insStr), (rope, gapBuffer)) =>
|
(fn (idx, (pos, delNum, insStr), (rope, gapBuffer)) =>
|
||||||
let
|
let
|
||||||
@@ -8,9 +8,14 @@ fun compareTxns arr =
|
|||||||
val oldRope = rope
|
val oldRope = rope
|
||||||
val strSize = String.size insStr
|
val strSize = String.size insStr
|
||||||
|
|
||||||
|
val rope =
|
||||||
|
if delNum > 0 then TinyRope.delete (pos, delNum, rope) else rope
|
||||||
val rope =
|
val rope =
|
||||||
if strSize > 0 then TinyRope.insert (pos, insStr, rope) else rope
|
if strSize > 0 then TinyRope.insert (pos, insStr, rope) else rope
|
||||||
|
|
||||||
|
val gapBuffer =
|
||||||
|
if delNum > 0 then LineGap.delete (pos, delNum, gapBuffer)
|
||||||
|
else gapBuffer
|
||||||
val gapBuffer =
|
val gapBuffer =
|
||||||
if strSize > 0 then LineGap.insert (pos, insStr, gapBuffer)
|
if strSize > 0 then LineGap.insert (pos, insStr, gapBuffer)
|
||||||
else gapBuffer
|
else gapBuffer
|
||||||
|
|||||||
Reference in New Issue
Block a user