2024-10-08 08:53:43 +01:00
|
|
|
structure AppWith =
|
|
|
|
|
struct
|
|
|
|
|
open AppType
|
|
|
|
|
|
|
|
|
|
fun bufferAndSize (app: app_type, newBuffer, newWidth, newHeight) =
|
|
|
|
|
let
|
2024-10-26 04:46:05 +01:00
|
|
|
val
|
|
|
|
|
{ mode
|
|
|
|
|
, buffer = _
|
|
|
|
|
, windowWidth = _
|
|
|
|
|
, windowHeight = _
|
|
|
|
|
, startLine
|
|
|
|
|
, cursorIdx
|
|
|
|
|
} = app
|
2024-10-08 08:53:43 +01:00
|
|
|
in
|
2024-10-26 04:46:05 +01:00
|
|
|
{ mode = mode
|
|
|
|
|
, buffer = newBuffer
|
2024-10-08 08:53:43 +01:00
|
|
|
, windowWidth = newWidth
|
|
|
|
|
, windowHeight = newHeight
|
|
|
|
|
, startLine = startLine
|
2024-10-09 10:59:32 +01:00
|
|
|
, cursorIdx = cursorIdx
|
2024-10-08 08:53:43 +01:00
|
|
|
}
|
|
|
|
|
end
|
2024-10-17 02:14:09 +01:00
|
|
|
|
2024-10-26 06:01:48 +01:00
|
|
|
fun bufferAndCursorIdx (app: app_type, newBuffer, newCursorIdx, newMode) =
|
2024-10-17 02:14:09 +01:00
|
|
|
let
|
2024-10-26 04:46:05 +01:00
|
|
|
val
|
2024-10-26 06:01:48 +01:00
|
|
|
{ mode = _
|
|
|
|
|
, buffer = _
|
|
|
|
|
, cursorIdx = _
|
|
|
|
|
, windowWidth
|
|
|
|
|
, windowHeight
|
|
|
|
|
, startLine
|
|
|
|
|
} = app
|
2024-10-17 02:14:09 +01:00
|
|
|
in
|
2024-10-26 06:01:48 +01:00
|
|
|
{ mode = newMode
|
2024-10-26 04:46:05 +01:00
|
|
|
, buffer = newBuffer
|
2024-10-17 02:14:09 +01:00
|
|
|
, cursorIdx = newCursorIdx
|
|
|
|
|
, windowWidth = windowWidth
|
|
|
|
|
, windowHeight = windowHeight
|
|
|
|
|
, startLine = startLine
|
|
|
|
|
}
|
|
|
|
|
end
|
2024-10-26 06:01:48 +01:00
|
|
|
|
|
|
|
|
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
|
2024-10-08 08:53:43 +01:00
|
|
|
end
|