only update search list if timestamp for search message is greater than the buffer's modified time

This commit is contained in:
2025-09-07 13:37:14 +01:00
parent f3c1905c0c
commit 299735f500
5 changed files with 20 additions and 12 deletions

View File

@@ -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) =