begin adding tests for 'yw' yank motion
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user