begin adding a 'bufferModifyTime' field to the app_type (lots of refactoring to do now)

This commit is contained in:
2025-08-20 12:17:07 +01:00
parent cdc8c0c734
commit 642814fb36
2 changed files with 5 additions and 27 deletions

View File

@@ -1,34 +1,11 @@
signature APP_TYPE = structure AppType =
sig
datatype mode = NORMAL_MODE of string
type app_type =
{ mode: mode
, buffer: LineGap.t
, searchList: SearchList.t
, searchString: string
, windowWidth: int
, windowHeight: int
(* line to start drawing from *)
, startLine: int
(* absolute index of movable cursor *)
, cursorIdx: int
(* msgs to send after an update.
* The list of messages is reset on each invocation of AppUpdate.update. *)
, msgs: MailboxType.t list
}
val init: LineGap.t * int * int -> app_type
end
structure AppType :> APP_TYPE =
struct struct
datatype mode = NORMAL_MODE of string datatype mode = NORMAL_MODE of string
type app_type = type app_type =
{ mode: mode { mode: mode
, buffer: LineGap.t , buffer: LineGap.t
, bufferModifyTime: Time.time
, searchList: SearchList.t , searchList: SearchList.t
, searchString: string , searchString: string
, windowWidth: int , windowWidth: int
@@ -42,9 +19,10 @@ struct
, msgs: MailboxType.t list , msgs: MailboxType.t list
} }
fun init (buffer, windowWidth, windowHeight) : app_type = fun init (buffer, windowWidth, windowHeight, time) : app_type =
{ mode = NORMAL_MODE "" { mode = NORMAL_MODE ""
, buffer = buffer , buffer = buffer
, bufferModifyTime = time
, searchList = SearchList.empty , searchList = SearchList.empty
, searchString = "" , searchString = ""
, windowWidth = windowWidth , windowWidth = windowWidth

View File

@@ -63,7 +63,7 @@ struct
val io = TextIO.openIn "temp.txt" val io = TextIO.openIn "temp.txt"
val lineGap = ioToLineGap (io, LineGap.empty) val lineGap = ioToLineGap (io, LineGap.empty)
val _ = TextIO.closeIn io val _ = TextIO.closeIn io
val app = AppType.init (lineGap, 1920, 1080) val app = AppType.init (lineGap, 1920, 1080, Time.now ())
(* todo: remove temp line below which tests search list *) (* todo: remove temp line below which tests search list *)
val app = val app =