add tests for 'd$' motion, and fix bug. When we are extending an existing match and reached the last index of the buffer, we used to return the searchList right away. However, we are meant to add the extended match before returning the searchList. We do this now, and the bug is fixed.

This commit is contained in:
2026-02-10 09:56:35 +00:00
parent 3c0a1dc034
commit 756f44e7f8
2 changed files with 167 additions and 3 deletions

View File

@@ -177,9 +177,12 @@ struct
fun tryExtendingPrevMatch
(idx, buffer, searchList, dfa, finalPos, curState, start) =
if idx = #textLength buffer then
(* reached end of buffer without finding anything
* so return current buffer and searchList *)
(buffer, searchList)
let
val searchList =
PersistentVector.extendExistingMatch (start, finalPos, searchList)
in
(buffer, searchList)
end
else if Dfa.isDead curState then
let
val searchList =