reimplement 't' movement motion the same way that 'f' movement motion was reimplemented in previous commit

This commit is contained in:
2025-10-18 14:05:25 +01:00
parent e44eae6d46
commit 239aaacfc5
2 changed files with 15 additions and 1 deletions

View File

@@ -565,7 +565,7 @@ struct
* tillNextChr with count of 1 has same effect
* as tillNextChr with any count above 1
* so just hardcode 1 *)
parseMoveToChr (1, app, Cursor.tillNextChr, chrCmd)
NormalMove.tillNextChr (app, count, chrCmd)
| #"T" =>
(* to just before chr, backward *)
parseMoveToChr (1, app, Cursor.tillPrevChr, chrCmd)

View File

@@ -530,4 +530,18 @@ struct
NormalFinish.buildTextAndClear
(app, buffer, newCursorIdx, searchList, [], bufferModifyTime)
end
fun tillNextChr (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 - 1, searchList, [], bufferModifyTime)
end
end