begin scaffolding NormalSearchMode (normal mode, except we are searching)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
structure AppType =
|
||||
struct
|
||||
datatype mode = NORMAL_MODE of string
|
||||
datatype mode = NORMAL_MODE of string | NORMAL_SEARCH_MODE of string
|
||||
|
||||
type app_type =
|
||||
{ mode: mode
|
||||
|
||||
@@ -2,6 +2,8 @@ structure AppUpdate =
|
||||
struct
|
||||
open AppType
|
||||
|
||||
fun update (app, msg, time) =
|
||||
case #mode app of NORMAL_MODE str => NormalMode.update (app, str, msg, time)
|
||||
fun update (app: app_type, msg, time) =
|
||||
case #mode app of
|
||||
NORMAL_MODE str => NormalMode.update (app, str, msg, time)
|
||||
| NORMAL_SEARCH_MODE str => NormalSearchMode.update (app, str, msg, time)
|
||||
end
|
||||
|
||||
12
fcore/normal-mode/normal-search-mode.sml
Normal file
12
fcore/normal-mode/normal-search-mode.sml
Normal file
@@ -0,0 +1,12 @@
|
||||
structure NormalSearchMode =
|
||||
struct
|
||||
open AppType
|
||||
open InputMsg
|
||||
|
||||
fun update (app, searchString, msg, time) =
|
||||
case msg of
|
||||
CHAR_EVENT chrCmd => app
|
||||
| KEY_ESC => Finish.clearMode app
|
||||
| RESIZE_EVENT (width, height) => app
|
||||
| WITH_SEARCH_LIST searchList => app
|
||||
end
|
||||
Reference in New Issue
Block a user