progress implementing help-prev-match for vector

This commit is contained in:
2025-10-08 10:27:19 +01:00
parent 3b823d7ae6
commit 0de7a9278a
5 changed files with 82 additions and 17 deletions

View File

@@ -778,7 +778,8 @@ struct
fun deleteToPrevMatch (app: app_type, count, time) =
let
val {cursorIdx, searchList, ...} = app
val newCursorIdx = SearchList.prevMatch (cursorIdx, searchList, count)
val newCursorIdx =
PersistentVector.prevMatch (cursorIdx, searchList, count)
in
if newCursorIdx = ~1 orelse newCursorIdx >= cursorIdx then
NormalFinish.clearMode app

View File

@@ -494,7 +494,8 @@ struct
, visualScrollColumn
, ...
} = app
val newCursorIdx = PersistentVector.nextMatch (cursorIdx, searchList, count)
val newCursorIdx =
PersistentVector.nextMatch (cursorIdx, searchList, count)
in
if newCursorIdx = ~1 then
NormalFinish.clearMode app
@@ -506,7 +507,8 @@ struct
fun moveToPrevMatch (app: app_type, count) =
let
val {cursorIdx, searchList, buffer, bufferModifyTime, ...} = app
val newCursorIdx = SearchList.prevMatch (cursorIdx, searchList, count)
val newCursorIdx =
PersistentVector.prevMatch (cursorIdx, searchList, count)
in
if newCursorIdx = ~1 then
NormalFinish.clearMode app

View File

@@ -188,7 +188,7 @@ struct
fun yankToPrevMatch (app: app_type, count) =
let
val {cursorIdx, searchList, buffer, ...} = app
val low = SearchList.prevMatch (cursorIdx, searchList, count)
val low = PersistentVector.prevMatch (cursorIdx, searchList, count)
in
if low = ~1 orelse low >= cursorIdx then
NormalFinish.clearMode app