delete 'nextMatch' function in search-list.sml, and refactor other code to use alternative function
This commit is contained in:
@@ -766,7 +766,8 @@ struct
|
|||||||
fun deleteToNextMatch (app: app_type, count, time) =
|
fun deleteToNextMatch (app: app_type, count, time) =
|
||||||
let
|
let
|
||||||
val {cursorIdx, searchList, ...} = app
|
val {cursorIdx, searchList, ...} = app
|
||||||
val newCursorIdx = SearchList.nextMatch (cursorIdx, searchList, count)
|
val newCursorIdx =
|
||||||
|
PersistentVector.nextMatch (cursorIdx, searchList, count)
|
||||||
in
|
in
|
||||||
if newCursorIdx = ~1 orelse newCursorIdx <= cursorIdx then
|
if newCursorIdx = ~1 orelse newCursorIdx <= cursorIdx then
|
||||||
NormalFinish.clearMode app
|
NormalFinish.clearMode app
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ struct
|
|||||||
fun yankToNextMatch (app: app_type, count) =
|
fun yankToNextMatch (app: app_type, count) =
|
||||||
let
|
let
|
||||||
val {cursorIdx, searchList, buffer, ...} = app
|
val {cursorIdx, searchList, buffer, ...} = app
|
||||||
val high = SearchList.nextMatch (cursorIdx, searchList, count)
|
val high = PersistentVector.nextMatch (cursorIdx, searchList, count)
|
||||||
in
|
in
|
||||||
if high = ~1 orelse high <= cursorIdx then
|
if high = ~1 orelse high <= cursorIdx then
|
||||||
NormalFinish.clearMode app
|
NormalFinish.clearMode app
|
||||||
|
|||||||
@@ -178,4 +178,11 @@ struct
|
|||||||
else
|
else
|
||||||
loopNextMatch (start, finish, tree, count - 1)
|
loopNextMatch (start, finish, tree, count - 1)
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@@ -122,7 +122,5 @@ struct
|
|||||||
else
|
else
|
||||||
(buffer, PersistentVector.empty)
|
(buffer, PersistentVector.empty)
|
||||||
|
|
||||||
fun nextMatch (cursorIdx, searchList, count) = raise Fail "todo: reimplement"
|
|
||||||
|
|
||||||
fun prevMatch (cursorIdx, searchList, count) = raise Fail "todo: reimplement"
|
fun prevMatch (cursorIdx, searchList, count) = raise Fail "todo: reimplement"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user