Skip to content

fix: keep cursor at vertical motion boundaries - #279

Open
s3onghyun wants to merge 1 commit into
replit:masterfrom
s3onghyun:fix/stop-vertical-motion-at-document-boundary
Open

s3onghyun wants to merge 1 commit into
replit:masterfrom
s3onghyun:fix/stop-vertical-motion-at-document-boundary

Conversation

@s3onghyun

Copy link
Copy Markdown

Normal-mode k on the first line and j on the last line should fail without moving the cursor, matching Vim/Neovim. Today the cursor jumps to the start/end of the line instead.

Keep the existing linewise operator behavior so dj/dk at a document boundary still select the expected lines.

Adds a regression test for both normal-mode boundaries (top k and bottom j preserve a nonzero column). types.ts now declares moveByLines as returning Pos | null to match.

Verified locally: pnpm run test (712 passing) and pnpm run testAll (CM6 712, CM5 708, package and TypeScript consumer builds).

Context: I maintain a small Vim/Neovim trainer that checks this emulator against headless Neovim 0.11 and currently carries this as a local patch; happy to adjust to your preferred approach.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant