break out of infinite loop in build-search-list.sml's 'helpBuild' function, by passing 'matchedIdx + 1' to tail call, and return correct matchedIdx value from 'helpNextMatch' function by adding 1 rather than subtracting

This commit is contained in:
2024-11-15 06:04:11 +00:00
parent 13d6d51fe9
commit df9c0e3b51
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ struct
if hdChr = searchChr then
if matchedChrs + 1 = String.size searchString then
let
val matchedIdx = absIdx - String.size searchString - 1
val matchedIdx = absIdx - String.size searchString + 1
in
SOME matchedIdx
end
@@ -57,7 +57,7 @@ struct
val searchList = SearchList.append (matchedIdx, searchList)
in
helpBuild
(app, origIdx, matchedIdx, buffer, searchString, searchList)
(app, origIdx, matchedIdx + 1, buffer, searchString, searchList)
end
| NONE =>
let

BIN
shf

Binary file not shown.