only update search list if timestamp for search message is greater than the buffer's modified time
This commit is contained in:
@@ -49,14 +49,21 @@ struct
|
||||
)
|
||||
end
|
||||
|
||||
fun withSearchList (app: app_type, searchList) =
|
||||
fun withSearchList (app: app_type, searchList, searchTime) =
|
||||
let
|
||||
val {buffer, searchString, cursorIdx, bufferModifyTime, ...} = app
|
||||
val app = NormalModeWith.searchList
|
||||
(app, searchList, buffer, searchString, bufferModifyTime)
|
||||
open Time
|
||||
in
|
||||
buildTextAndClear
|
||||
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||
if searchTime >= #bufferModifyTime app then
|
||||
let
|
||||
val {buffer, searchString, cursorIdx, bufferModifyTime, ...} = app
|
||||
val app = NormalModeWith.searchList
|
||||
(app, searchList, buffer, searchString, bufferModifyTime)
|
||||
in
|
||||
buildTextAndClear
|
||||
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
|
||||
end
|
||||
else
|
||||
app
|
||||
end
|
||||
|
||||
fun resizeText (app: app_type, newWidth, newHeight) =
|
||||
|
||||
@@ -522,8 +522,8 @@ struct
|
||||
| KEY_ESC => NormalFinish.clearMode app
|
||||
| RESIZE_EVENT (width, height) =>
|
||||
NormalFinish.resizeText (app, width, height)
|
||||
| WITH_SEARCH_LIST searchList =>
|
||||
NormalFinish.withSearchList (app, searchList)
|
||||
| WITH_SEARCH_LIST (searchList, time) =>
|
||||
NormalFinish.withSearchList (app, searchList, time)
|
||||
|
||||
(* Don't need to handle these keys in normal mode.
|
||||
* Everything that is possible through them in Vi and Vim
|
||||
|
||||
@@ -141,8 +141,8 @@ struct
|
||||
moveLeft (app, searchString, tempSearchList, searchCursorIdx)
|
||||
| ARROW_RIGHT =>
|
||||
moveRight (app, searchString, tempSearchList, searchCursorIdx)
|
||||
| WITH_SEARCH_LIST searchList =>
|
||||
NormalSearchModeWith.searchList (app, searchList)
|
||||
| WITH_SEARCH_LIST (searchList, time) =>
|
||||
NormalFinish.withSearchList (app, searchList, time)
|
||||
| RESIZE_EVENT (width, height) =>
|
||||
NormalSearchFinish.resize
|
||||
(app, width, height, searchCursorIdx, tempSearchList)
|
||||
|
||||
Reference in New Issue
Block a user