amend implementation of 'yw' so that we do not yank newline following last word in line, if we are trying to yank last word

This commit is contained in:
2026-02-04 10:12:04 +00:00
parent 83c660818e
commit 1f2af6aacd
3 changed files with 51 additions and 67 deletions

View File

@@ -203,9 +203,13 @@ struct
val buffer = LineGap.goToIdx (cursorIdx, buffer)
val high = fMove (buffer, cursorIdx, count)
val high = if high = #textLength buffer then high - 1 else high
val beforeHigh = high - 1
val buffer = LineGap.goToIdx (beforeHigh, buffer)
val high =
if Cursor.isOnNewlineAfterChr (buffer, beforeHigh) then beforeHigh
else high
val buffer = LineGap.goToIdx (high, buffer)
val length = high - cursorIdx
val str = LineGap.substring (cursorIdx, length, buffer)
in