progress parsing normal mode commands

This commit is contained in:
2024-10-26 06:01:48 +01:00
parent defb17af20
commit 816f064558
3 changed files with 141 additions and 53 deletions

View File

@@ -22,13 +22,18 @@ struct
}
end
fun bufferAndCursorIdx (app: app_type, newBuffer, newCursorIdx) =
fun bufferAndCursorIdx (app: app_type, newBuffer, newCursorIdx, newMode) =
let
val
{mode, buffer = _, cursorIdx = _, windowWidth, windowHeight, startLine} =
app
{ mode = _
, buffer = _
, cursorIdx = _
, windowWidth
, windowHeight
, startLine
} = app
in
{ mode = mode
{ mode = newMode
, buffer = newBuffer
, cursorIdx = newCursorIdx
, windowWidth = windowWidth
@@ -36,4 +41,18 @@ struct
, startLine = startLine
}
end
fun mode (app: app_type, newMode) =
let
val {mode = _, buffer, cursorIdx, windowWidth, windowHeight, startLine} =
app
in
{ mode = newMode
, buffer = buffer
, cursorIdx = cursorIdx
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = startLine
}
end
end