create an 'exitToNormalMode' function which exits NORMAL_SEARCH_MODE and creates a message to redraw the screen so that it looks like normal mode
This commit is contained in:
@@ -66,6 +66,16 @@ struct
|
|||||||
onSearchChanged (app, searchString, tempSearchList, buffer)
|
onSearchChanged (app, searchString, tempSearchList, buffer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
(* return to normal mode, keeping the same searchString and searchList
|
||||||
|
* from before entering this mode. *)
|
||||||
|
fun exitToNormalMode (app: app_type) =
|
||||||
|
let
|
||||||
|
val {buffer, cursorIdx, searchList, bufferModifyTime, ...} = app
|
||||||
|
in
|
||||||
|
NormalFinish.buildTextAndClear
|
||||||
|
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||||
|
end
|
||||||
|
|
||||||
(* save search string and tempSearchList and return to normal mode *)
|
(* save search string and tempSearchList and return to normal mode *)
|
||||||
fun finishSearch (app: app_type, searchString, tempSearchList) =
|
fun finishSearch (app: app_type, searchString, tempSearchList) =
|
||||||
let
|
let
|
||||||
@@ -103,7 +113,7 @@ struct
|
|||||||
fun update (app, {searchString, tempSearchList}, msg, time) =
|
fun update (app, {searchString, tempSearchList}, msg, time) =
|
||||||
case msg of
|
case msg of
|
||||||
CHAR_EVENT chr => addChr (app, searchString, chr)
|
CHAR_EVENT chr => addChr (app, searchString, chr)
|
||||||
| KEY_ESC => NormalFinish.clearMode app
|
| KEY_ESC => exitToNormalMode app
|
||||||
| KEY_ENTER => finishSearch (app, searchString, tempSearchList)
|
| KEY_ENTER => finishSearch (app, searchString, tempSearchList)
|
||||||
| RESIZE_EVENT (width, height) => app
|
| RESIZE_EVENT (width, height) => app
|
||||||
| WITH_SEARCH_LIST searchList => app
|
| WITH_SEARCH_LIST searchList => app
|
||||||
|
|||||||
Reference in New Issue
Block a user