unescape an escaped search string
This commit is contained in:
@@ -4,6 +4,11 @@ struct
|
|||||||
open InputMsg
|
open InputMsg
|
||||||
open MailboxType
|
open MailboxType
|
||||||
|
|
||||||
|
fun buildTempSearchList (searchString, buffer, cursorIdx) =
|
||||||
|
let val unescapedString = EscapeString.unescape searchString
|
||||||
|
in SearchList.buildRange (buffer, unescapedString, cursorIdx + 1111)
|
||||||
|
end
|
||||||
|
|
||||||
fun addChr (app: app_type, searchString, searchCursorIdx, chr) =
|
fun addChr (app: app_type, searchString, searchCursorIdx, chr) =
|
||||||
let
|
let
|
||||||
val {cursorIdx, buffer, ...} = app
|
val {cursorIdx, buffer, ...} = app
|
||||||
@@ -23,8 +28,7 @@ struct
|
|||||||
val searchCursorIdx = searchCursorIdx + 1
|
val searchCursorIdx = searchCursorIdx + 1
|
||||||
|
|
||||||
val buffer = LineGap.goToIdx (cursorIdx - 1111, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx - 1111, buffer)
|
||||||
val tempSearchList =
|
val tempSearchList = buildTempSearchList (searchString, buffer, cursorIdx)
|
||||||
SearchList.buildRange (buffer, searchString, cursorIdx + 1111)
|
|
||||||
in
|
in
|
||||||
NormalSearchFinish.onSearchChanged
|
NormalSearchFinish.onSearchChanged
|
||||||
(app, searchString, tempSearchList, searchCursorIdx, buffer)
|
(app, searchString, tempSearchList, searchCursorIdx, buffer)
|
||||||
@@ -44,7 +48,9 @@ struct
|
|||||||
fun saveSearch (app: app_type, searchString, tempSearchList) =
|
fun saveSearch (app: app_type, searchString, tempSearchList) =
|
||||||
let
|
let
|
||||||
val {buffer, cursorIdx, windowWidth, windowHeight, startLine, ...} = app
|
val {buffer, cursorIdx, windowWidth, windowHeight, startLine, ...} = app
|
||||||
|
|
||||||
val buffer = LineGap.goToStart buffer
|
val buffer = LineGap.goToStart buffer
|
||||||
|
val searchString = EscapeString.unescape searchString
|
||||||
val initialMsg = [SEARCH (buffer, searchString)]
|
val initialMsg = [SEARCH (buffer, searchString)]
|
||||||
|
|
||||||
(* move LineGap to first line displayed on screen *)
|
(* move LineGap to first line displayed on screen *)
|
||||||
@@ -96,7 +102,7 @@ struct
|
|||||||
val {cursorIdx, buffer, ...} = app
|
val {cursorIdx, buffer, ...} = app
|
||||||
val buffer = LineGap.goToIdx (cursorIdx - 1111, buffer)
|
val buffer = LineGap.goToIdx (cursorIdx - 1111, buffer)
|
||||||
val tempSearchList =
|
val tempSearchList =
|
||||||
SearchList.buildRange (buffer, searchString, cursorIdx + 1111)
|
buildTempSearchList (searchString, buffer, cursorIdx)
|
||||||
in
|
in
|
||||||
NormalSearchFinish.onSearchChanged
|
NormalSearchFinish.onSearchChanged
|
||||||
(app, searchString, tempSearchList, searchCursorIdx, buffer)
|
(app, searchString, tempSearchList, searchCursorIdx, buffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user