github saberzero1/motions 0.14.0

latest releases: 1.4.0, 1.3.1, 1.3.0...
3 months ago

Added

  • Which-key for all partial keys — the which-key overlay now triggers on any partial key sequence (operators like d, c, y and prefix keys like g, z, [, ]), not just the leader key. After a 500ms delay, a multi-column panel at the bottom of the editor shows available continuations. Configurable via Settings → Vim Motions → Which-key hints with three modes: off, leader key only, all partial keys (default: off).
    • Operator-pending mode (d …) shows grouped next-key options: single-key motions directly (w, j, $), multi-key prefixes collapsed (i → +N text objects, a → +N text objects)
    • Partial prefix keys (g …, z …) show getCompletions() results from the fork's keymap introspection API
    • Special keys (<Left>, <C-n>, etc.) and insert-only entries are filtered out
    • Leader bindings from settings and vimrc are shown with friendly command names
    • Overlay positioned at bottom of editor pane (not viewport), max 40% height, multi-column grid layout
  • E2E test suite test/specs/which-key.e2e.ts with 31 tests covering all three modes (off/leader/all), settings hot-reload, leader registry integration, and fork API integration (getKeymap/getCompletions)

Changed

  • Which-key setting — enableWhichKey boolean replaced with whichKeyMode dropdown ('off' | 'leader' | 'all'). Default changed from implicit leader-only to explicit 'off'.
  • Which-key overlay rewritten — WhichKeyOverlay class generalized from leader-only to support any partial key sequence. Uses getInputState() for operator-pending detection and vim.status for partial key chord display. DOM attachment changed from editorEl.parentElement to view.contentEl for reliable positioning.
  • VimState type fix — mode field changed from required 'normal' | 'insert' | 'visual' | 'replace' to optional string to match runtime behavior (the field is only set by the CM6 ViewPlugin's mode-change handler, not by the initial vim state).
  • Plugin deviations reduced — test/neovim/deviations.ts reduced from 20 to 10 entries. 10 deviations removed after verifying the fork now matches Neovim: ) sentence motion, di( multiline, db cross-line, dw empty line, d2w cross-line, dge empty lines, diw word boundary, da" trailing space, :join cursor, :global cursor.
  • Fork test count — 17 new fork-level tests for async motion dispatch (6), getKeymap() API (5), and getCompletions() API (6). Total: 1628 fork tests passing.
  • Fork golden comparison — re-recorded 756 golden cases from Neovim 0.12.2 with per-step state capture. 476 pass, 0 unexpected diffs, 280 known deviations (down from 284). Fixed 3 duplicate test name collisions and empty :s flag behavior.

Fixed

  • da" trailing space — da" on say "hello world" end now produces say end (single space) instead of say end (double space). The fork's findBeginningAndEnd now consumes adjacent whitespace after inclusive quote expansion, matching Neovim.
  • :join cursor position — :join ex command now positions cursor at column 0 of the joined line, matching Neovim. Previously placed cursor at the join point.
  • :global cursor position — :g/pattern/d now positions cursor at the last matched line after execution, matching Neovim. Non-destructive :g commands leave cursor where the last sub-command placed it.
  • Empty :s flag behavior — :s with no arguments no longer preserves the /g flag from the previous substitution. Only the first match on the line is replaced, matching Neovim.
  • % string-awareness — updated KNOWN_LIMITATIONS.md to reflect that % is only partially fixed: the forward-seek check works, but findMatchingBracket still does positional counting without string awareness.
  • Which-key graceful degradation — getInputState(), getKeymap(), and getCompletions() calls in the which-key overlay now check typeof before invocation, preventing errors when built-in vim mode is active (these APIs are fork-only).
  • Cursor shape settings in built-in mode — cursor shape dropdowns are now disabled with an explanatory message when Obsidian's built-in vim mode is active (cursor shapes require bundled fork mode).
  • g-commands golden data — corrected incorrect Neovim recordings for g$ (cursor ch:11→10, mode visual→normal) and guu (content unchanged→lowercased). Full vim-builtin e2e suite now passes 16/16.

Documentation

  • DIFFERENCES.md (fork): added "Keymap introspection API" section documenting getKeymap() and getCompletions()
  • DIFFERENCES.md (fork): updated "Empty :s flag preservation" → "Empty :s uses default flags", added da" whitespace, :join cursor, :global cursor sections, updated golden comparison stats
  • KNOWN_LIMITATIONS.md: "Which-key overlay scope" section rewritten to reflect the new all-keys mode
  • KNOWN_LIMITATIONS.md: updated % + strings entry to "Partially fixed" with explanation of remaining findMatchingBracket limitation
  • KNOWN_LIMITATIONS.md: added da", :join, :global, :s empty entries to behavioral deviations table
  • KNOWN_LIMITATIONS.md: corrected vi* single-char status from "Fixed" to "Not fixed"
  • AGENTS.md: updated fork test count (1421→1628) and golden comparison stats
  • README.md: which-key description updated and settings list updated with new dropdown

Full Changelog: 0.13.0...0.14.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.