pass 'maxLength' value to TextScroll function so that we can prevent scrolling past the bottom of the file (unless we want to od so by centtering the screen)

This commit is contained in:
2025-09-19 23:17:28 +01:00
parent d3fa4d08bf
commit 090e7ccea2
4 changed files with 28 additions and 10 deletions

View File

@@ -29,7 +29,8 @@ struct
val cursorLine = LineGap.idxToLineNumber (cursorIdx, buffer)
val startLine =
TextScroll.getStartLine (prevLineNumber, cursorLine, windowHeight)
TextScroll.getStartLine
(prevLineNumber, cursorLine, windowHeight, #lineLength buffer)
(* move buffer to new startLine as required by TextBuilder.build *)
val buffer = LineGap.goToLine (startLine, buffer)