amend error with buffer having wrong index
This commit is contained in:
@@ -1062,6 +1062,7 @@ struct
|
|||||||
let
|
let
|
||||||
val nextIdx = moveIdx + String.size rightStringsHd
|
val nextIdx = moveIdx + String.size rightStringsHd
|
||||||
val _ = println "1021"
|
val _ = println "1021"
|
||||||
|
val _ = println ("origIdx = " ^ Int.toString origIdx)
|
||||||
in
|
in
|
||||||
if nextIdx < finish then
|
if nextIdx < finish then
|
||||||
(* Keep moving right. *)
|
(* Keep moving right. *)
|
||||||
@@ -1259,6 +1260,8 @@ struct
|
|||||||
(* Start deleting from the end of this string,
|
(* Start deleting from the end of this string,
|
||||||
* and then continue deleting rightwards. *)
|
* and then continue deleting rightwards. *)
|
||||||
let
|
let
|
||||||
|
val _ = println "1263"
|
||||||
|
val _ = println ("1263 idx = " ^ Int.toString curIdx)
|
||||||
val length = start - curIdx
|
val length = start - curIdx
|
||||||
val newString = String.substring (rightStringsHd, 0, length)
|
val newString = String.substring (rightStringsHd, 0, length)
|
||||||
|
|
||||||
@@ -1290,6 +1293,8 @@ struct
|
|||||||
let
|
let
|
||||||
val newLeftStringsHd = leftStringsHd ^ newString
|
val newLeftStringsHd = leftStringsHd ^ newString
|
||||||
val _ = println "1163"
|
val _ = println "1163"
|
||||||
|
val _ = println ("curIdx = " ^ Int.toString curIdx)
|
||||||
|
val _ = println ("nextIdx = " ^ Int.toString nextIdx)
|
||||||
val newLeftLinesHd =
|
val newLeftLinesHd =
|
||||||
Vector.tabulate
|
Vector.tabulate
|
||||||
( Vector.length leftLinesHd
|
( Vector.length leftLinesHd
|
||||||
@@ -1304,8 +1309,13 @@ struct
|
|||||||
) + String.size leftStringsHd
|
) + String.size leftStringsHd
|
||||||
)
|
)
|
||||||
in
|
in
|
||||||
|
(* moveIdx passed as arameter should be
|
||||||
|
* different from origIdx,
|
||||||
|
* because moveIdx considers range to delete from
|
||||||
|
* while origIdx considers index to return
|
||||||
|
* once buffer is done deleting. *)
|
||||||
deleteRightFromHere
|
deleteRightFromHere
|
||||||
( nextIdx
|
( curIdx + String.size newString
|
||||||
, nextLine
|
, nextLine
|
||||||
, nextIdx
|
, nextIdx
|
||||||
, finish
|
, finish
|
||||||
@@ -2006,6 +2016,8 @@ struct
|
|||||||
, Int.toString start
|
, Int.toString start
|
||||||
, "| start + length = "
|
, "| start + length = "
|
||||||
, Int.toString (start + length)
|
, Int.toString (start + length)
|
||||||
|
, "| bufferIdx = "
|
||||||
|
, Int.toString (#idx buffer)
|
||||||
])
|
])
|
||||||
in
|
in
|
||||||
del
|
del
|
||||||
|
|||||||
Reference in New Issue
Block a user