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 =
|
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
|
||||||
|
|||||||
@@ -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 =
|
||||||
|
|||||||
Reference in New Issue
Block a user