reimplement 'f' move motion more efficiently, not leaving the LineGap.t data structure while iterating to next count

This commit is contained in:
2025-10-18 14:01:06 +01:00
parent 597b5beb3d
commit e44eae6d46
3 changed files with 64 additions and 3 deletions

View File

@@ -516,4 +516,18 @@ struct
NormalFinish.buildTextAndClear
(app, buffer, newCursorIdx, searchList, [], bufferModifyTime)
end
fun toNextChr (app: app_type, count, chr) =
let
val {cursorIdx, buffer, searchList, bufferModifyTime, ...} = app
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val newCursorIdx =
Cursor.toNextChrNew (buffer, cursorIdx, {findChr = chr, count = count})
in
if newCursorIdx = ~1 then
NormalFinish.clearMode app
else
NormalFinish.buildTextAndClear
(app, buffer, newCursorIdx, searchList, [], bufferModifyTime)
end
end