Skip to content

v1.2.6 — Fix: y yanked the wrong line near a file's end

Choose a tag to compare

@fermat-tech fermat-tech released this 16 Sep 07:06
· 1 commit to main since this release

What's fixed

  • y (yank current line) copied the wrong line whenever the target line fell within the document's final page — including any file shorter than one screen. Ng/NG (jump to line N) and search matches could set the intended target line, but the pager's scroll clamp (which correctly prevents scrolling past the point where content runs out) silently snapped the view back, and y read whatever was left at the top instead of the line you actually navigated to.

    Example: on a 2-line file, 2g then y always yanked line 1, never line 2, because the whole file already fits on screen and the view can never scroll further.

    Fix: the pager now tracks the exact navigation target separately from the (correctly) clamped scroll position, and y yanks that target. Verified with new tests exercising the real key-handling and scroll/search code against tcell'"'"'s own simulation-screen test backend, including the exact short-file case, a long-file final-page case, and a regression guard that ordinary scrolling still yanks the top-of-screen line as before.

Binaries

File Target
winless_windows_amd64.exe Windows x64 (most PCs)
winless_windows_arm64.exe Windows on ARM (Surface Pro X, Copilot+ PCs)