add preferredColumn field to app type

This commit is contained in:
2024-10-18 06:44:45 +01:00
parent 92b834427c
commit 5f4be185e8
4 changed files with 27 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ struct
fun resizeText (app: app_type, newWidth, newHeight) =
let
val {buffer, windowWidth, windowHeight, startLine, cursorIdx} = app
val {buffer, windowWidth, windowHeight, startLine, cursorIdx, ...} = app
val newBuffer = LineGap.goToLine (startLine, buffer)
val drawMsg = TextBuilder.build
@@ -21,7 +21,7 @@ struct
fun moveRight (app: app_type) =
let
val {buffer, windowWidth, windowHeight, startLine, cursorIdx} = app
val {buffer, windowWidth, windowHeight, startLine, cursorIdx, ...} = app
(* move LineGap to cursorIdx, which is necessary for finding newCursorIdx *)
val buffer = LineGap.goToIdx (cursorIdx, buffer)
@@ -39,7 +39,7 @@ struct
fun moveLeft (app: app_type) =
let
val {buffer, windowWidth, windowHeight, startLine, cursorIdx} = app
val {buffer, windowWidth, windowHeight, startLine, cursorIdx, ...} = app
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val cursorIdx = Cursor.viH (buffer, cursorIdx)