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

BIN
shf

Binary file not shown.