reimplement 't' movement motion the same way that 'f' movement motion was reimplemented in previous commit
This commit is contained in:
@@ -565,7 +565,7 @@ struct
|
|||||||
* tillNextChr with count of 1 has same effect
|
* tillNextChr with count of 1 has same effect
|
||||||
* as tillNextChr with any count above 1
|
* as tillNextChr with any count above 1
|
||||||
* so just hardcode 1 *)
|
* so just hardcode 1 *)
|
||||||
parseMoveToChr (1, app, Cursor.tillNextChr, chrCmd)
|
NormalMove.tillNextChr (app, count, chrCmd)
|
||||||
| #"T" =>
|
| #"T" =>
|
||||||
(* to just before chr, backward *)
|
(* to just before chr, backward *)
|
||||||
parseMoveToChr (1, app, Cursor.tillPrevChr, chrCmd)
|
parseMoveToChr (1, app, Cursor.tillPrevChr, chrCmd)
|
||||||
|
|||||||
@@ -530,4 +530,18 @@ struct
|
|||||||
NormalFinish.buildTextAndClear
|
NormalFinish.buildTextAndClear
|
||||||
(app, buffer, newCursorIdx, searchList, [], bufferModifyTime)
|
(app, buffer, newCursorIdx, searchList, [], bufferModifyTime)
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user