Added
g_motion — moves to the last non-blank character of the current line (or count-1 lines forward). Inclusive motion matching Neovim'sg_.dg_deletes through the last non-blank character, preserving trailing whitespace.- Fork:
~/Repos/codemirror-vim/src/vim.js(newmoveToLastNonWhiteSpaceCharactermotion handler andg_keybinding) - Fork:
~/Repos/codemirror-vim/src/types.ts(type definition)
- Fork:
Fixed
g^andg0display-line motions behaved identically — both calledcursorLineBoundaryBackward, which implements Home-key toggle behavior (first non-blank ↔ column 0).g0incorrectly went to first non-blank instead of column 0, andg^toggled instead of always going to first non-blank. Nowg0unconditionally moves to column 0 of the visual line, andg^unconditionally moves to the first non-blank character of the visual line, matching Neovim. (#141)- Fork:
~/Repos/codemirror-vim/src/vim.js(newmoveToFirstNonBlankOfDisplayLinehandler forg^;moveToStartOfDisplayLinenow usesgoDisplayLineStart) - Fork:
~/Repos/codemirror-vim/src/cm_adapter.ts(newgoDisplayLineStartexec command usingview.moveToLineBoundary) - Fork:
~/Repos/codemirror-vim/src/types.ts(type definition formoveToFirstNonBlankOfDisplayLine)
- Fork:
Tests
- 7 new e2e tests in
test/specs/vim-builtin/g-commands.e2e.ts:g0always column 0,g^from mid-line,g^from column 0,g^idempotent at first non-blank,g_trailing spaces,g_no trailing spaces,g_empty line,2g_count,dg_operator-pending (#141) - 7 new Neovim golden test definitions in
test/neovim/test-definitions.ts(g0indented,g^indented,g^no whitespace,g^idempotent,g_trailing spaces,g_no trailing,2g_count) - Golden data recorded in
test/neovim/golden-data/g-commands.json
Documentation
CHANGELOG.mdAGENTS.md: addedg0/g^/g_fork motion descriptions- Fork:
~/Repos/codemirror-vim/DIFFERENCES.md: addedg0/g^fix under "Behavioral fixes (Neovim parity)" andg_under "New default keymap entries"
Full Changelog: 0.125.0...0.126.0