begin adding a 'bufferModifyTime' field to the app_type (lots of refactoring to do now)
This commit is contained in:
@@ -1,34 +1,11 @@
|
||||
signature APP_TYPE =
|
||||
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 =
|
||||
structure AppType =
|
||||
struct
|
||||
datatype mode = NORMAL_MODE of string
|
||||
|
||||
type app_type =
|
||||
{ mode: mode
|
||||
, buffer: LineGap.t
|
||||
, bufferModifyTime: Time.time
|
||||
, searchList: SearchList.t
|
||||
, searchString: string
|
||||
, windowWidth: int
|
||||
@@ -42,9 +19,10 @@ struct
|
||||
, msgs: MailboxType.t list
|
||||
}
|
||||
|
||||
fun init (buffer, windowWidth, windowHeight) : app_type =
|
||||
fun init (buffer, windowWidth, windowHeight, time) : app_type =
|
||||
{ mode = NORMAL_MODE ""
|
||||
, buffer = buffer
|
||||
, bufferModifyTime = time
|
||||
, searchList = SearchList.empty
|
||||
, searchString = ""
|
||||
, windowWidth = windowWidth
|
||||
|
||||
@@ -63,7 +63,7 @@ struct
|
||||
val io = TextIO.openIn "temp.txt"
|
||||
val lineGap = ioToLineGap (io, LineGap.empty)
|
||||
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 *)
|
||||
val app =
|
||||
|
||||
Reference in New Issue
Block a user