in text builders, check when on newline if this is the second last character in the file, and draw it on a newline if so. This is to align with the design decision that we want the second-last character to be selectable
This commit is contained in:
@@ -3,6 +3,11 @@ struct
|
|||||||
structure TC = TextConstants
|
structure TC = TextConstants
|
||||||
structure Utils = TextBuilderUtils
|
structure Utils = TextBuilderUtils
|
||||||
|
|
||||||
|
fun isSecondLastChr (pos, str, tl) =
|
||||||
|
case tl of
|
||||||
|
[] => pos = String.size str - 2
|
||||||
|
| _ => false
|
||||||
|
|
||||||
fun goToFirstLineAfter
|
fun goToFirstLineAfter
|
||||||
(stl, ltl, posY, lineNumber, absIdx, cursorIdx, env, acc) =
|
(stl, ltl, posY, lineNumber, absIdx, cursorIdx, env, acc) =
|
||||||
case (stl, ltl) of
|
case (stl, ltl) of
|
||||||
@@ -135,6 +140,11 @@ struct
|
|||||||
#"\n" =>
|
#"\n" =>
|
||||||
if lineNumber + 1 > #lastLineNumber env then
|
if lineNumber + 1 > #lastLineNumber env then
|
||||||
acc
|
acc
|
||||||
|
else if isSecondLastChr (pos, str, stl) then
|
||||||
|
if absIdx = cursorIdx then
|
||||||
|
Utils.makeCursor (#startX env, posY + TC.ySpace, env) :: acc
|
||||||
|
else
|
||||||
|
acc
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
val acc =
|
val acc =
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ struct
|
|||||||
structure TC = TextConstants
|
structure TC = TextConstants
|
||||||
structure Utils = TextBuilderUtils
|
structure Utils = TextBuilderUtils
|
||||||
|
|
||||||
|
fun isSecondLastChr (pos, str, tl) =
|
||||||
|
case tl of
|
||||||
|
[] => pos = String.size str - 2
|
||||||
|
| _ => false
|
||||||
|
|
||||||
fun goToFirstLineAfter
|
fun goToFirstLineAfter
|
||||||
(stl, ltl, posY, lineNumber, absIdx, cursorIdx, env, acc, searchPos) =
|
(stl, ltl, posY, lineNumber, absIdx, cursorIdx, env, acc, searchPos) =
|
||||||
case (stl, ltl) of
|
case (stl, ltl) of
|
||||||
@@ -232,6 +237,11 @@ struct
|
|||||||
| #"\n" =>
|
| #"\n" =>
|
||||||
if lineNumber + 1 > #lastLineNumber env then
|
if lineNumber + 1 > #lastLineNumber env then
|
||||||
acc
|
acc
|
||||||
|
else if isSecondLastChr (pos, str, stl) then
|
||||||
|
if absIdx = cursorIdx then
|
||||||
|
Utils.makeCursor (#startX env, posY + TC.ySpace, env) :: acc
|
||||||
|
else
|
||||||
|
acc
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
val acc =
|
val acc =
|
||||||
|
|||||||
Reference in New Issue
Block a user