begin refactoring to let cursor move to very last char of file (including unix line ending)

This commit is contained in:
2025-09-23 10:50:10 +01:00
parent 8931d4d071
commit 961ce63023
5 changed files with 13 additions and 27 deletions

View File

@@ -3,11 +3,6 @@ struct
structure TC = TextConstants
structure Utils = TextBuilderUtils
fun isSecondLastChr (pos, str, tl) =
case tl of
[] => pos = String.size str - 2
| _ => false
fun goToFirstLineAfter
(stl, ltl, posY, lineNumber, absIdx, cursorIdx, env, acc) =
case (stl, ltl) of
@@ -140,11 +135,6 @@ struct
#"\n" =>
if lineNumber + 1 > #lastLineNumber env then
acc
else if isSecondLastChr (pos, str, stl) then
if absIdx = cursorIdx then
Utils.makeCursor (#startX env, posY + TC.ySpace, env) :: acc
else
acc
else
let
val acc =

View File

@@ -237,11 +237,6 @@ struct
| #"\n" =>
if lineNumber + 1 > #lastLineNumber env then
acc
else if isSecondLastChr (pos, str, stl) then
if absIdx = cursorIdx then
Utils.makeCursor (#startX env, posY + TC.ySpace, env) :: acc
else
acc
else
let
val acc =