begin adding tests for 'yw' yank motion

This commit is contained in:
2026-02-04 09:26:57 +00:00
parent 2a8785a373
commit 83c660818e
4 changed files with 253 additions and 15 deletions

View File

@@ -68,17 +68,12 @@ struct
let
val cursorIdx = Int.max (textLength - 1, 0)
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val cursorIdx =
if Cursor.isOnNewlineAfterChr (buffer, cursorIdx) then cursorIdx - 1
else cursorIdx
in
if Cursor.isOnNewlineAfterChr (buffer, cursorIdx) then
let
val cursorIdx = cursorIdx - 1
in
NormalFinish.buildTextAndClear
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
end
else
NormalFinish.buildTextAndClear
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
NormalFinish.buildTextAndClear
(app, buffer, cursorIdx, searchList, [], bufferModifyTime)
end
else
NormalFinish.buildTextAndClear

View File

@@ -200,9 +200,10 @@ struct
fun yankWhenMovingForward (app: app_type, fMove, count) =
let
val {buffer, cursorIdx, ...} = app
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val high = fMove (buffer, cursorIdx, count)
val high = if high = #textLength buffer then high - 1 else high
val buffer = LineGap.goToIdx (high, buffer)
val length = high - cursorIdx