begin moving text window when cursor goes off screen (currently, we only move the window when cursor goes backwards but this works fine and as expected)

This commit is contained in:
2024-10-28 09:34:55 +00:00
parent deab30c46d
commit 4b1ee33954
7 changed files with 120 additions and 41 deletions

View File

@@ -7,10 +7,7 @@ end
structure TextBuilder :> TEXT_BUILDER =
struct
val xSpace = 13
val xSpace3 = xSpace * 3
val ySpace = 25
val fontSize = 30.0
open TextConstants
fun accToDrawMsg (textAcc, cursorAcc) =
let
@@ -480,7 +477,6 @@ struct
fun build
(startLine, cursorPos, lineGap: LineGap.t, windowWidth, windowHeight) =
let
val lineGap = LineGap.goToLine (startLine, lineGap)
val {rightStrings, rightLines, line = curLine, idx = curIdx, ...} = lineGap
in
case (rightStrings, rightLines) of
@@ -504,9 +500,7 @@ struct
end
else
0
val absIdx = curIdx + startIdx
in
if cursorPos < curIdx + String.size rStrHd then
(* if cursor is within string *)