github saberzero1/motions 0.7.0

latest releases: 1.0.1, 1.0.0, 0.150.0...
3 months ago

Fixed

  • EasyMotion (<leader><leader>w/j/f) and hint mode (<leader><leader>h) now work with any leader key, including space (let mapleader = " ") and comma. Previously, leader keys with default Vim bindings (space → forward char, comma → reverse repeat find) were consumed immediately by codemirror-vim before the multi-key sequence could accumulate. Fixed by unmapping the leader key's conflicting default binding before registering EasyMotion mapCommand entries. (#6)
  • Vimrc let mapleader = " " (space) now correctly sets the leader key. The parser previously split the line by whitespace, losing the space inside quotes. Added regex-first parsing for let to preserve quoted values containing whitespace.
  • Vimrc loading no longer falsely reports "loaded but contained no commands" when the editor isn't ready. loadVimrc now distinguishes "editor not available" (ready: false, retries on next event) from "file parsed with 0 commands" (ready: true). Includes a retry loop (up to 10 attempts, 100ms apart) to handle the race between active-leaf-change and editor initialization.
  • Leader-dependent features (EasyMotion, hint mode) are re-registered after vimrc loading resolves the leader key, ensuring they use the user's configured leader instead of the default backslash.
  • Visual mode selection on markdown text objects (vi*, va*, vi$, va$, vi~, va~, vi=, va=, vi_, va_, vi`, va`, vil, val, viC, vaC, viB, vaB, vio, vao, vit, vat) now selects the correct range — previously selected one character too far to the right. Operators (d, y, c) were unaffected. Root cause: codemirror-vim's makeCmSelection adds +1 to the head position in visual mode, and built-in text objects compensate via an internal expandSelection helper, but custom defineMotion text objects bypassed that path. (#4)
  • ]b with a single buffer no longer opens a stale file from a previous session's recent-files list.
  • vgq (visual mode gq) no longer triggers macro recording. The vim-keypress handler for macro recording previously intercepted the q keystroke in gq as a macro-record toggle. Fixed by restricting macro recording to normal mode only (matching Vim behavior), tracking previous keypress to detect g-prefixed operator sequences, and cancelling pending record state on mode changes. (#5)

Added

  • VimRegistration.unmapDefaultBinding(key) — removes a key's default codemirror-vim binding (e.g. <Space> → l) so mapCommand multi-key sequences starting with that key can accumulate in the input buffer.
  • VimrcLoadResult.ready field — distinguishes "editor not available" from "file parsed successfully", enabling reliable retry logic for vimrc loading.
  • E2E tests for EasyMotion with space and comma as leader keys, verifying the unmap + mapCommand approach works for keys with default Vim bindings.
  • E2E test for EasyMotion surviving settings hot-reload (disable → re-enable cycle).
  • getSelection() test helper for asserting exact visual mode selections.
  • loadSingleFileWorkspace() test helper using obsidianPage.loadWorkspaceLayout() to set up deterministic single-file workspace state with an empty recent-files list.
  • 14 new E2E tests verifying exact visual mode selection for all delimiter-based text objects (*, $, ~, =, _, `), plus regression guards for operator mode.
  • E2E tests for gq in visual mode (wrap + no macro recording), gqq macro non-interference, and standalone q macro recording start/stop.
  • 3 Neovim golden comparison cases for gq operators (gqq, Vgq, gqj) added to the g-commands suite with content deviation registered (Markdown-aware wrapping differs from Neovim's plain-text gq).

Changed

  • registerEasyMotion() now calls reg.unmapDefaultBinding(leader) before registering mapCommand entries, allowing any single-character leader key to work.
  • registerWorkspaceNavigation() hint mode binding uses the resolved leader key from LeaderRegistry (same approach as EasyMotion).
  • createHintModeAction() return type narrowed from ActionFn to () => void (the function ignores all parameters).
  • VimrcLoadResult gains ready: boolean field; loadVimrc() returns ready: false when the editor adapter is unavailable.
  • Vimrc active-leaf-change callback retries loadVimrc up to 10 times when the editor isn't ready, then re-registers leader-dependent features after successful load.
  • KNOWN_LIMITATIONS.md: "EasyMotion leader key conflict with mapCommand" marked as fixed; added vimrc parser space-handling context.
  • KNOWN_LIMITATIONS.md: added "Visual mode on single-character text objects" section documenting a codemirror-vim edge case where vi* on *x* (1-char inner content) does not select correctly.

Full Changelog: 0.6.0...0.7.0

Don't miss a new motions release

NewReleases is sending notifications on new releases.