github saberzero1/motions 0.128.0

latest releases: 1.4.0, 1.3.1, 1.3.0...
one month ago

Fixed

  • EasyMotion line motions (j/k) operate characterwise instead of linewise in operator-pending mode — d<leader><leader>j{label} deleted from cursor column to the target position (characterwise) instead of deleting full lines (linewise). Native Vim j/k have motionArgs: { linewise: true }. Added linewise: true to both easyMotionLine and easyMotionLineBack definitions.
    • Plugin: src/easymotion/register.ts (added motionArgs: { linewise: true, forward: true/false } to line motion entries)
  • EasyMotion forward motions do not set motionArgs.forward — the fork's clipToLine function (which clips trailing newline+whitespace for multi-line forward operations) never fired for EasyMotion motions. Added forward: true or forward: false to all 17 directional EasyMotion motion definitions.
    • Plugin: src/easymotion/register.ts (added forward flag to all EASYMOTION_DEFS entries)
  • Insert-mode surround macro recording — <C-g>s{char} keys typed during insert mode were not logged to the macro key buffer. The fork's handleKeyInsertMode now calls logKey when a full insert-mode command is matched, recording the complete key sequence to the macro register.
    • Fork: ~/Repos/codemirror-vim/src/vim.js (handleKeyInsertMode — logKey on match.type == 'full')
  • easyMotionRepeat operator-pending mode — easyMotionRepeat was registered as an action (defineAction) which cannot participate in operator-pending mode. Changed to a motion (defineMotion) with mapCommand binding at <leader><leader>.. The motion inherits motionArgs from the last executed EasyMotion motion, so operators apply with correct linewise/inclusive/forward flags.
    • Plugin: src/easymotion/register.ts (changed from defineAction to defineMotion + mapCommand, added lastMotionArgs storage)
  • :m/:t newline handling at document boundaries — moving or copying lines to position 0 (top of file) or after the last line produced concatenated text without newline separation. Fixed getLineRangeText to include the preceding newline separator when extracting the last line, and createMoveCopyCommand to insert with correct newline placement at boundaries.
    • Plugin: src/workspace/commands.ts (getLineRangeText boundary handling, createMoveCopyCommand insert text normalization)
  • Table cell count prefixes — 3j in both table-nav overlay mode and cell editor mode performed a single cell crossing instead of three. Three changes: (1) table-nav keymap now accumulates digit keys as a count prefix and passes the count to navigate(). (2) navigate() loops count times for directional movement. (3) Cross-cell motion overrides (moveByLines, moveByDisplayLines) now loop repeat times through getCellBelow/getCellAbove, stopping at table boundaries.
    • Plugin: src/vim/table-nav-keymap.ts (digit accumulation, consumeCount(), count parameter on navigation keys)
    • Plugin: src/vim/table-nav-controller.ts (navigate() count parameter, loop)
    • Plugin: src/vim/table-cell-motions.ts (createMoveByLines, createMoveByDisplayLines repeat loop)
  • Cross-cell word motions — w/b/e/W/B/E/ge/gE at cell boundaries did not jump to the adjacent cell. Added a moveByWords override in table-cell-motions.ts that detects when the word motion result is null or stuck at a boundary, and crosses to the next/previous cell via getNextCell.
    • Plugin: src/vim/table-cell-motions.ts (new createMoveByWords override, registered in applyTableCellMotions)
  • Table-nav dot-repeat for structural commands — . in table-nav mode now repeats the last structural command (o, O, dd, dc, J, K, H, L, I, A). Count prefix works (3. repeats 3 times). Cleared on cell edit entry so vim's native . handles text edits.
    • Plugin: src/vim/table-nav-keymap.ts (lastStructuralAction tracking, . handler with count)
    • Plugin: src/vim/table-nav-controller.ts (clearLastStructuralAction on cell edit entry)
  • Multi-line t column 0 exclusion — forward t{char} targets at column 0 were excluded entirely instead of wrapping to the previous line's last character. Fixed in both flash (applyTillOffset in char-mode.ts) and EasyMotion (findTillTargets in targets.ts). Targets at column 0 of line 0 (no previous line) are still excluded.
    • Plugin: src/flash/char-mode.ts (applyTillOffset — wrap to previous line)
    • Plugin: src/easymotion/targets.ts (findTillTargets — same fix)
  • EXTRA_DEFS bidirectional motions lack motionArgs — easyMotionBdEndWord, easyMotionBdEndWORD, easyMotionBdTill now have inclusive: true, and easyMotionBdLine has linewise: true. Applied via Object.assign(motionArgs, defArgs) inside the motion function body, bypassing the defineMotion-only limitation.
    • Plugin: src/easymotion/register.ts (EXTRA_DEFS motionArgs + motion function mutation)
  • Tab/Shift+Tab in table-nav — Tab in cell edit mode now exits the cell and returns to table-nav on the next cell. Tab/Shift+Tab also work directly in table-nav mode as cell navigation (equivalent to l/h). Count prefix works (3Tab moves 3 cells forward).
    • Plugin: src/vim/table-nav-keymap.ts (Tab/Shift+Tab case in nav handler)
    • Plugin: src/vim/table-nav-controller.ts (Tab/Shift+Tab Scope handlers in cell edit)

Tests

  • 3 new e2e tests in test/specs/easymotion-comprehensive.e2e.ts: d+easymotion j linewise delete, y+easymotion j linewise yank with register flag, d+easymotion k linewise delete upward
  • 2 new e2e tests in test/specs/easymotion-comprehensive.e2e.ts: d+easyMotionRepeat operator-pending delete, d+easyMotionRepeat after line motion preserves linewise
  • 1 new e2e test in test/specs/surround.e2e.ts: macro register contains <C-g>s keys after recording
  • 6 crash-guard tests in test/specs/vim-builtin/ex-move-copy-normal.e2e.ts strengthened to behavioral assertions (:m0, :m$, :m-2, :1,2m$, :t$, :1,2t$) + 2 new tests (:m3, :t0)
  • 2 new e2e tests in test/specs/table-nav-mode.e2e.ts: 3j moves 3 rows in table-nav, 2l moves 2 columns
  • 2 new e2e tests in test/specs/table-cell-vim-mode.e2e.ts: cross-cell w at end of cell, cross-cell b at start of cell
  • 3 new e2e tests in test/specs/table-nav-mode.e2e.ts: . repeats o, 2. repeats twice, . cleared after cell edit
  • 3 new unit tests in test/unit/flash-targets.test.ts: findTillTargets column 0 wrap, column 0 line 0 exclusion, non-zero column
  • 2 new e2e tests in test/specs/table-nav-mode.e2e.ts: Tab in cell edit returns to nav, Shift+Tab navigates backward
  • 1 new e2e test in test/specs/flash-char-mode.e2e.ts: multi-line t wraps to previous line end at column 0
  • 1 new e2e test in test/specs/easymotion-comprehensive.e2e.ts: y + easyMotionBdLine via mapCommand yanks linewise (EXTRA_DEFS motionArgs)

Documentation

  • CHANGELOG.md
  • KNOWN_LIMITATIONS.md: marked EasyMotion linewise, forward motionArgs, insert-mode surround macro recording, easyMotionRepeat operator-pending, :m/:t address parsing, table count prefixes, cross-cell word motions, table-nav dot-repeat, multi-line t column 0, EXTRA_DEFS motionArgs, and Tab/Shift+Tab in table-nav as fixed
  • CONTRIBUTING.md: updated easymotion/register.ts and table-cell-motions.ts descriptions, table-nav-keymap.ts description
  • Fork: ~/Repos/codemirror-vim/DIFFERENCES.md (updated insert-mode surround macro recording section)
  • docs/features/tables.md: added count prefix, cross-cell word motions (w/b/e), dot-repeat (.), Tab/Shift+Tab to keybindings table and native mode navigation table
  • docs/features/easymotion.md: added "Repeat last motion" section with <leader><leader>. binding
  • docs/reference/keybindings.md: added "EasyMotion repeat" section with <leader><leader>. binding

Full Changelog: 0.127.0...0.128.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.