Commit Graph

3 Commits

Author SHA1 Message Date
gffranco 21ac9deb23 Fix glp backward cycle and gl<Space> current-list scope
CI / cargo fmt --check (push) Successful in 16s
CI / cargo clippy (push) Successful in 21s
CI / cargo test (push) Successful in 37s
CI / cargo fmt --check (pull_request) Successful in 34s
CI / cargo clippy (pull_request) Successful in 36s
CI / cargo test (pull_request) Successful in 38s
CI / editor keymaps (push) Successful in 1m23s
CI / editor keymaps (pull_request) Successful in 1m31s
Two documented checkbox-list mappings did not match their spec:

- `glp` dispatched the same forward-only cycleCheckbox as `gln`, so it
  could never "cycle the checkbox state backward". Add `ops::cycle_state_back`
  and thread a `reverse` flag through the dispatcher and both clients.

- `gl<Space>` and `gL<Space>` both swept the whole buffer, making them
  identical. `gl<Space>` now passes the cursor position and the server
  scopes deletion to the contiguous list block under the cursor (current
  list, cascading into sublists); `gL<Space>` stays whole-buffer.

Adds Rust unit tests, plus behavioral and full-registration coverage for
the documented mapping surface in the Neovim and Vim keymap harnesses, and
a command-coverage suite mirroring the doc's command groups.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 13:56:28 -03:00
gffranco a489bea480 test(keymaps): hard timeouts + serialise the CI job behind test
CI / cargo fmt --check (push) Successful in 29s
CI / cargo clippy (push) Successful in 1m16s
CI / cargo test (push) Successful in 1m18s
CI / editor keymaps (push) Failing after 2m25s
User reported the editor-keymaps CI job hung for 30 minutes before
"Has been cancelled" — twice in a row. Two changes to keep that from
happening again:

1. Wrap both harness invocations with `timeout` (60s Neovim, 30s
   Vim). A misbehaving LSP attach, a stuck `vim.defer_fn`, or
   ex-mode hung on stdin can no longer hold the runner indefinitely;
   `timeout` kills the process and the wrapper exits non-zero so CI
   shows the real failure shape.

2. `</dev/null` on `vim -e -s` so ex-mode doesn't sit waiting for
   input on CI's non-TTY stdin (the local zsh run inherits the
   user's tty, masking this).

3. CI: the keymaps job now has `needs: test` and
   `timeout-minutes: 10`. `needs: test` serialises behind the cargo
   jobs so we don't fight for the single Gitea runner, and the
   workflow-level timeout is a belt to the script-level `timeout`'s
   braces — if for some reason both fail the same way, the runner
   reclaims itself in 10 minutes instead of 30.

Local timing: `test-keymaps.sh` 10.4s, `test-keymaps-vim.sh` 0.1s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 13:17:10 +00:00
gffranco 5fdd7a842e test(keymaps): Vim path harness + fix 25 broken one-liner functions
CI / cargo fmt --check (push) Successful in 19s
CI / cargo clippy (push) Successful in 1m10s
CI / cargo test (push) Successful in 1m20s
CI / editor keymaps (push) Has been cancelled
User asked about the Vim path of the keymap suite. Building it
surfaced a real bug: 25 of our autoload functions were written as
`function! foo() abort | call bar() | endfunction` one-liners, which
isn't valid Vim syntax — `function!` requires a multi-line body, and
Vim parses the `|` after `abort` as an unexpected trailing character
(E488). Most invocations of the buggy autoload functions errored
out the moment Vim tried to parse them, which is why the user saw
broken keymaps and confusing diagnostics.

Rewrote all 25 one-liners (`autoload/nuwiki/commands.vim`) into the
standard three-line form. Affected groups: `diary_*`, `toggle_list_item`,
`cycle_list_item`, `reject_list_item`, `heading_add`, `heading_remove`,
`toc_generate`, `links_generate`, `export_current` / `_all` /
`_all_force` / `_rss`, and the §13.1 deferred stubs (`list_change_lvl`,
`list_remove_done`, `table_*`, `colorize`, `paste_link`, `paste_url`).

Added `scripts/test-keymaps-vim.{sh,vim}` — a Vim-side counterpart of
the Neovim harness covering the pure-VimL bindings (header nav,
link nav, `o`/`O` bullet continuation, `<CR>` wrap step). The
LSP-roundtrip bindings (`<C-Space>`, `=`, `-`, …) stay on the Neovim
side because vim-lsp's async layer uses timers that don't fire
inside `vim -e -s` headless mode — their server-side codepath is
already exercised by the Neovim harness and the cargo test suite.

Vim harness covers 12 cases: filetype + 2 command-presence smoke
tests, 4 header-nav (`]]`/`[[`/`]=`/`]u`), `<Tab>` link-nav, `<CR>`
wrap-on-first-press, and 3 bullet-continuation flows.

CI: extended the existing `keymaps` job to install both nvim + vim
and run both harnesses. Verified locally:

  Neovim harness:  19 passed, 0 failed
  Vim harness:     12 passed, 0 failed

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:41:46 +00:00