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