some progress moving textWindow, but it is not perfect yet

This commit is contained in:
2024-10-28 10:59:18 +00:00
parent 4b1ee33954
commit 0ed5a23ade
3 changed files with 76 additions and 4 deletions

View File

@@ -23,12 +23,13 @@ struct
if count = 0 then
let
val {windowWidth, windowHeight, startLine, ...} = app
(* todo: get new startLine if cursor has moved out of screen *)
val startLine = TextWindow.getStartLine
(buffer, startLine, cursorIdx, windowWidth, windowHeight)
(* move LineGap to first line displayed on screen, and build new text *)
val buffer = LineGap.goToLine (startLine, buffer)
val startLine = TextWindow.getStartLine
(buffer, startLine, cursorIdx, windowWidth, windowHeight)
val drawMsg = TextBuilder.build
(startLine, cursorIdx, buffer, windowWidth, windowHeight)
@@ -60,6 +61,10 @@ struct
(* move LineGap to first line displayed on screen, and build new text *)
val buffer = LineGap.goToLine (startLine, buffer)
val startLine = TextWindow.getStartLine
(buffer, startLine, cursorIdx, windowWidth, windowHeight)
val drawMsg = TextBuilder.build
(startLine, cursorIdx, buffer, windowWidth, windowHeight)