in cursor.sml's 'viJ' function, make sure to call helpViJString with nest str hd/tl, when strIdx is in the strTl
This commit is contained in:
@@ -361,16 +361,16 @@ struct
|
|||||||
(* no more strings so return last idx *)
|
(* no more strings so return last idx *)
|
||||||
absIdx)
|
absIdx)
|
||||||
| _ =>
|
| _ =>
|
||||||
if lineColumn <> preferredColumn orelse not hasPassedLine then
|
if lineColumn = preferredColumn andalso hasPassedLine then
|
||||||
|
(* we're at the preferredColumn so return absIdx *)
|
||||||
|
absIdx
|
||||||
|
else
|
||||||
(* we're not in the preferred column, so keep iterating *)
|
(* we're not in the preferred column, so keep iterating *)
|
||||||
helpViJString
|
helpViJString
|
||||||
( strPos + 1, str, absIdx + 1
|
( strPos + 1, str, absIdx + 1
|
||||||
, lineColumn + 1, preferredColumn, hasPassedLine
|
, lineColumn + 1, preferredColumn, hasPassedLine
|
||||||
, strTl, lineTl
|
, strTl, lineTl
|
||||||
)
|
)
|
||||||
else
|
|
||||||
(* we're at the preferredColumn so return absIdx *)
|
|
||||||
absIdx
|
|
||||||
|
|
||||||
and helpViJList
|
and helpViJList
|
||||||
(absIdx, lineColumn, preferredColumn, hasPassedLine, strings, lines) =
|
(absIdx, lineColumn, preferredColumn, hasPassedLine, strings, lines) =
|
||||||
@@ -436,16 +436,19 @@ struct
|
|||||||
in
|
in
|
||||||
if String.sub (nestStrHd, strIdx) = #"\n" then
|
if String.sub (nestStrHd, strIdx) = #"\n" then
|
||||||
helpViJString
|
helpViJString
|
||||||
(strIdx + 1, strHd, cursorIdx + 1, 0, 0, true, strTl, lnTl)
|
( strIdx + 1, nestStrHd, cursorIdx + 1
|
||||||
|
, 0, 0, true
|
||||||
|
, nestStrTl, nestLnTl
|
||||||
|
)
|
||||||
else
|
else
|
||||||
(* not in linebreak *)
|
(* not in linebreak *)
|
||||||
let
|
let
|
||||||
val lineColumn = getCursorColumn (lineGap, cursorIdx)
|
val lineColumn = getCursorColumn (lineGap, cursorIdx)
|
||||||
in
|
in
|
||||||
helpViJString
|
helpViJString
|
||||||
( strIdx + 1, strHd, cursorIdx + 1
|
( strIdx + 1, nestStrHd, cursorIdx + 1
|
||||||
, lineColumn, lineColumn, false
|
, lineColumn, lineColumn, false
|
||||||
, strTl, lnTl
|
, nestStrTl, nestStrTl
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user