add search list to app type

This commit is contained in:
2024-11-14 08:12:27 +00:00
parent 91663a6cae
commit cae9f19787
5 changed files with 37 additions and 10 deletions

View File

@@ -1,11 +1,12 @@
signature APP_TYPE =
sig
datatype mode =
NORMAL_MODE of string
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 *)
@@ -19,12 +20,13 @@ end
structure AppType :> APP_TYPE =
struct
datatype mode =
NORMAL_MODE of string
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 *)
@@ -36,6 +38,8 @@ struct
fun init (buffer, windowWidth, windowHeight) : app_type =
{ mode = NORMAL_MODE ""
, buffer = buffer
, searchList = SearchList.empty
, searchString = ""
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = 0

View File

@@ -7,6 +7,8 @@ struct
val
{ startLine = _
, buffer = _
, searchList
, searchString
, mode
, windowWidth
, windowHeight
@@ -15,6 +17,8 @@ struct
in
{ startLine = startLine
, buffer = newBuffer
, searchList = searchList
, searchString = searchString
, mode = mode
, windowWidth = windowWidth
, windowHeight = windowHeight
@@ -29,6 +33,8 @@ struct
, buffer = _
, windowWidth = _
, windowHeight = _
, searchList
, searchString
, startLine
, cursorIdx
} = app
@@ -37,6 +43,8 @@ struct
, buffer = newBuffer
, windowWidth = newWidth
, windowHeight = newHeight
, searchList = searchList
, searchString = searchString
, startLine = startLine
, cursorIdx = cursorIdx
}
@@ -49,15 +57,19 @@ struct
{ mode = _
, buffer = _
, cursorIdx = _
, startLine = _
, searchList
, searchString
, windowWidth
, windowHeight
, startLine = _
} = app
in
{ mode = newMode
, buffer = newBuffer
, cursorIdx = newCursorIdx
, startLine = newStartLine
, searchList = searchList
, searchString = searchString
, windowWidth = windowWidth
, windowHeight = windowHeight
}
@@ -65,11 +77,21 @@ struct
fun mode (app: app_type, newMode) =
let
val {mode = _, buffer, cursorIdx, windowWidth, windowHeight, startLine} =
app
val
{ mode = _
, buffer
, searchList
, searchString
, cursorIdx
, windowWidth
, windowHeight
, startLine
} = app
in
{ mode = newMode
, buffer = buffer
, searchList = searchList
, searchString = searchString
, cursorIdx = cursorIdx
, windowWidth = windowWidth
, windowHeight = windowHeight

View File

@@ -7,7 +7,7 @@ sig
val mapFromNum: int * int * t -> t
end
structure SearchList =
structure SearchList :> SEARCH_LIST =
struct
type t = {left: int vector list, right: int vector list}

BIN
shf

Binary file not shown.

View File

@@ -9,11 +9,12 @@ message-types/input-msg.sml
message-types/draw-msg.sml
message-types/mailbox-type.sml
fcore/bin-search.sml
fcore/search-list.sml
fcore/app-type.sml
fcore/app-with.sml
fcore/bin-search.sml
fcore/search-list.sml
fcore/text-constants.sml
ann
"allowVectorExps true"