diff --git a/fcore/normal-mode/make-normal-delete.sml b/fcore/normal-mode/make-normal-delete.sml index 31d460f..f3a1f60 100644 --- a/fcore/normal-mode/make-normal-delete.sml +++ b/fcore/normal-mode/make-normal-delete.sml @@ -766,7 +766,8 @@ struct fun deleteToNextMatch (app: app_type, count, time) = let val {cursorIdx, searchList, ...} = app - val newCursorIdx = SearchList.nextMatch (cursorIdx, searchList, count) + val newCursorIdx = + PersistentVector.nextMatch (cursorIdx, searchList, count) in if newCursorIdx = ~1 orelse newCursorIdx <= cursorIdx then NormalFinish.clearMode app diff --git a/fcore/normal-mode/normal-yank.sml b/fcore/normal-mode/normal-yank.sml index 3d3615f..117e946 100644 --- a/fcore/normal-mode/normal-yank.sml +++ b/fcore/normal-mode/normal-yank.sml @@ -168,7 +168,7 @@ struct fun yankToNextMatch (app: app_type, count) = let val {cursorIdx, searchList, buffer, ...} = app - val high = SearchList.nextMatch (cursorIdx, searchList, count) + val high = PersistentVector.nextMatch (cursorIdx, searchList, count) in if high = ~1 orelse high <= cursorIdx then NormalFinish.clearMode app diff --git a/fcore/persistent-vector.sml b/fcore/persistent-vector.sml index a771ef6..db9941d 100644 --- a/fcore/persistent-vector.sml +++ b/fcore/persistent-vector.sml @@ -178,4 +178,11 @@ struct else loopNextMatch (start, finish, tree, count - 1) end + + fun getLast tree = + case tree of + LEAF (values, _) => + Vector.sub (values, Vector.length values - 1) + | BRANCH (nodes, _) => + getLast (Vector.sub (nodes, Vector.length nodes - 1)) end diff --git a/fcore/search-list/search-list.sml b/fcore/search-list/search-list.sml index d9685a6..a143687 100644 --- a/fcore/search-list/search-list.sml +++ b/fcore/search-list/search-list.sml @@ -122,7 +122,5 @@ struct else (buffer, PersistentVector.empty) - fun nextMatch (cursorIdx, searchList, count) = raise Fail "todo: reimplement" - fun prevMatch (cursorIdx, searchList, count) = raise Fail "todo: reimplement" end