feat(parity): close the entire P3 Commands section
CI / cargo fmt --check (push) Successful in 17s
CI / cargo clippy (push) Successful in 24s
CI / cargo test (push) Successful in 42s
CI / editor keymaps (push) Successful in 1m40s

All six remaining command gaps (client-side; no server change):

- VimwikiRenameFile: bare -> -nargs=? (arg accepted-ignored; rename still
  delegates to the LSP rename prompt). No more E488.

- VimwikiVar / NuwikiVar: get/set the client config (upstream vimwiki#vars#cmd).
  No arg prints config (Vim: g:nuwiki_*; Neovim: resolved setup() opts), one arg
  gets a key, two+ sets it. Global command, both clients.

- VimwikiReturn / NuwikiReturn: command form of the smart <CR> continuation —
  enters insert at EOL and fires the <CR> mapping (return_cmd / vimwiki_return).
  Upstream's mode-flag args accepted but unused.

- VimwikiTableAlignQ vs AlignW: corrected — upstream's gqq/gww are identical on
  a table; the only difference is the non-table fallback (native `normal! gqq`
  vs `gww`). New table_align_or_cmd(cmd) aligns on a table row, else runs
  `normal! <cmd>`. Q/gqq/gq1 -> gqq; W/gww/gw1 -> gww; NuwikiTableAlign -> gqq.

- VimwikiSearch / VWS: scope the lvimgrep to the current wiki's root (resolved
  client-side) over <root>/**/*<ext>, not CWD `**`; empty pattern reuses the
  last search. Both clients.

- VimwikiIndex family: add global Vimwiki/NuwikiIndex + TabIndex entry points
  (plugin/nuwiki.vim + init.lua _setup_global_commands, with -count), so a wiki
  opens from any buffer. Buffer-local copies still shadow inside wiki buffers.

Tests: surface.{Vimwiki,Nuwiki}{Return,Var}, cmd.VimwikiVar_sets_*,
cmd.global_entry_points (both harnesses). Docs (README + doc/nuwiki.txt) and the
gap doc updated. Neovim 299, Vim 291/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 01:23:07 +00:00
parent 3865b8bf0e
commit a11b742fc1
11 changed files with 334 additions and 52 deletions
+58 -25
View File
@@ -181,27 +181,43 @@ fix site.
`-complete=…pages`); `<q-args>` joins a spaced name and an empty arg reaches
the prompt. Both handlers already prompt on empty. Covered by
`cmd.VimwikiGoto_accepts_multiword` (`test-keymaps-vim.vim`).
- [ ] **`VimwikiRenameFile` lacks `-nargs=?`** _(new, 2026-06-03 re-audit)_
upstream is `-nargs=? -complete=…file`; nuwiki's defs are bare, so
`:VimwikiRenameFile foo` raises E488. Subsumed by the existing "rename
delegates to the LSP rename request, takes no filename arg" divergence (the
`-complete=` item below) — adding `-nargs=?` (accepted-ignored) would restore
signature parity if desired. Low priority.
- [ ] `VimwikiVar` — config-var get/set introspection. _Fix:_ `plugin/nuwiki.vim`.
- [x] **`VimwikiRenameFile` `-nargs=?`** _(new, 2026-06-03 re-audit; fixed
2026-06-03)_ — upstream is `-nargs=? -complete=…file`; nuwiki's defs were bare,
so `:VimwikiRenameFile foo` raised E488. _Fix:_ all four defs are now
`-nargs=?` (arg accepted-and-ignored — rename still delegates to the LSP rename
request, which drives its own prompt). No more E488.
- [x] **`VimwikiVar`/`NuwikiVar`** _(fixed 2026-06-03)_ — config-var get/set
introspection (upstream `vimwiki#vars#cmd`). _Fix:_ global command in both
clients — no arg prints the client config (Vim: every `g:nuwiki_*`; Neovim: the
resolved `setup()` options), one arg gets a key, two+ sets it (server-backed
settings need a restart, which the echo notes). `nuwiki#commands#var` /
`commands.var`. Covered by `cmd.VimwikiVar_sets_global` (vim) /
`cmd.VimwikiVar_sets_option` (nvim) + `surface.{Vimwiki,Nuwiki}Var`.
- [x] **`VimwikiShowVersion`** _(fixed 2026-06-03)_ — added global
`VimwikiShowVersion`/`NuwikiShowVersion` (both clients) echoing
`g:nuwiki_version` (`0.1.0`) + the host editor, via
`nuwiki#commands#show_version` / `commands.show_version`. Covered by
`surface.{Vimwiki,Nuwiki}ShowVersion` in both keymap harnesses.
- [ ] `VimwikiReturn` — no Ex-command (mapping-driven only). _Fix:_ `ftplugin/vimwiki.vim`.
- [ ] `VimwikiTableAlignQ` vs `AlignW` collapsed to one `table_align``gqq`
(align) vs `gww` (align w/o resize) distinction still lost (the remaining
open part). _(Re-audit 2026-05-31: also the attr differed — bare vs upstream's
`-nargs=?`, so `:VimwikiTableAlignQ 2` raised E488.)_ _Attr part fixed
2026-06-03:_ `VimwikiTableAlignQ`/`AlignW` + `NuwikiTableAlign` are now
`-nargs=?` in all contexts (the optional column arg is accepted-and-ignored
pending the align-vs-resize split), so the E488 is gone. Covered by
`cmd.search_and_tablealign_nargs` (`test-keymaps-vim.vim`).
- [x] **`VimwikiReturn`/`NuwikiReturn`** _(fixed 2026-06-03)_ — upstream exposes
the smart-`<CR>` continuation as a command; nuwiki had it only as the
insert-mode `<expr>` mapping. _Fix:_ buffer-local `-nargs=*` command in both
clients that enters insert at EOL and triggers the same `<CR>` mapping
(`return_cmd` / `vimwiki_return`), continuing the list item / table row.
Upstream's mode-flag args are accepted but unused (continuation is inferred
from the line). Covered by `surface.{Vimwiki,Nuwiki}Return`.
- [x] **`VimwikiTableAlignQ` vs `AlignW`** _(fixed 2026-06-03; earlier framing
corrected)_ — the earlier note ("`gqq` align vs `gww` align-without-resize")
mis-read upstream: `vimwiki#tbl#align_or_cmd('gqq'|'gww')` calls the **same**
`vimwiki#tbl#format` when on a table — the only difference is the **non-table
fallback** (`normal! gqq` vs `normal! gww`, native paragraph-format; `gw` keeps
the cursor put). nuwiki had both unconditionally call `table_align`, so off a
table they did nothing. _Fix:_ a shared `table_align_or_cmd(cmd)` (both clients)
aligns when on a table row, else runs `normal! <cmd>``gqq`/`gq1` +
`VimwikiTableAlignQ``gqq`; `gww`/`gw1` + `VimwikiTableAlignW``gww`;
`NuwikiTableAlign``gqq`. (The `-nargs=?` attribute + the partial-column `2`
arg, accepted-and-ignored, are unchanged; true partial-column align stays a
separate deeper table feature.) Covered by `cmd.search_and_tablealign_nargs`
(`test-keymaps-vim.vim`) + the table alignment cases that still route through it.
- [x] `VimwikiTable` was `-nargs=1` vs upstream `-nargs=*` (couldn't pass
cols+rows). _Fix:_ all four defs (Vim+Neovim × Vimwiki+Nuwiki) are now
`-nargs=*` and forward `<f-args>` to `table_insert` (which already parsed
@@ -247,13 +263,16 @@ fix site.
`{ all: true }`; the server (`tags_rebuild`) re-indexes **every** configured
wiki (via `wikis_snapshot()`) instead of just the current one. `-bang` added to
all four command defs.
- [ ] `:VimwikiSearch` / `VWS` uses `lvimgrep`, not vimwiki's search engine
(the remaining open part — a deliberate, simpler implementation). _(Re-audit
2026-05-31: also `-nargs=1` vs upstream `-nargs=*`.)_ _Attr part fixed
2026-06-03:_ both are now `-nargs=*` (Vim + Neovim), so a multi-word
`:VimwikiSearch foo bar` no longer raises E488 and an empty `:VimwikiSearch`
reuses the last search pattern (`lvimgrep //`). Covered by
`cmd.search_and_tablealign_nargs` (`test-keymaps-vim.vim`).
- [x] **`:VimwikiSearch` / `VWS` now scope to the wiki** _(fixed 2026-06-03)_
upstream's search runs over the wiki's files, not the editor's CWD; nuwiki's
`lvimgrep /<args>/ **` searched CWD-relative `**`. _Fix:_ both commands route
through `nuwiki#commands#search` / `commands.search` (both clients), which
resolves the wiki whose root contains the current file (else the first
configured wiki, else CWD) and `lvimgrep`s `<root>/**/*<ext>` into the location
list; an empty pattern reuses the last search (`@/`). The `-nargs=*` attr fix
(2026-06-03) is folded in. _(nuwiki uses Vim's `lvimgrep` rather than a bespoke
engine — the same mechanism vimwiki uses — so this is full behavioral parity.)_
Covered by `cmd.search_and_tablealign_nargs` (`test-keymaps-vim.vim`).
- [x] **`VimwikiChangeSymbolTo` / `VimwikiListChangeSymbolI` lack `-range`**
_(new, 2026-05-31 re-audit; fixed same day)_ — upstream both carry
`-range -nargs=1`; nuwiki had `-nargs=1` only, so a visual-range invocation
@@ -279,8 +298,15 @@ fix site.
day)_ — added `NuwikiGenerateTags` (Vim + Neovim) mirroring
`VimwikiGenerateTags``tags_generate_links`, with `-nargs=?` +
`-complete=…tags`. Covered by `cmd.NuwikiGenerateTags_exists` (both harnesses).
- [ ] `VimwikiIndex` family is buffer-local in nuwiki (upstream defines globally
in `plugin/`); only `:…UISelect` is a global entry point.
- [x] **`VimwikiIndex` family now has global entry points** _(fixed 2026-06-03)_
— upstream defines the Index family in `plugin/`; nuwiki had `Index`/`TabIndex`
only buffer-local (so a wiki couldn't be opened from a non-wiki buffer; only
`:…UISelect`/`:…ShowVersion` were global). _Fix:_ global
`Vimwiki/NuwikiIndex` + `Vimwiki/NuwikiTabIndex` (with `-count` for the wiki
number) added in `plugin/nuwiki.vim` (Vim) and `init.lua`
`_setup_global_commands` (Neovim), dispatching to the existing
`wiki_index`/`wiki_tab_index`. The buffer-local copies still shadow them inside
wiki buffers. Covered by `cmd.global_entry_points` in both harnesses.
- [x] **`VimwikiColorize` / `NuwikiColorize` drop their argument in the Neovim
branch** — both are `-nargs=1`, but the Neovim defs called `colorize()` with no
`<q-args>` (`ftplugin/vimwiki.vim:445,517`) while the Vim branch passes it. The
@@ -671,3 +697,10 @@ audits don't re-flag them.
(both ON upstream → out-of-box divergences, implemented same day),
`table_reduce_last_col`, `user_htmls`, `hl_headers`/`hl_cb_checked` logged; and
a `commentstring` value-mismatch note. No previously-closed item regressed.
- Cleared the **entire P3 Commands section** (2026-06-03): `VimwikiRenameFile`
`-nargs=?`; `VimwikiVar`/`NuwikiVar` (get/set client config); `VimwikiReturn`/
`NuwikiReturn` (command form of smart-`<CR>`); the `TableAlignQ` vs `AlignW`
split (corrected — the real difference is the non-table `normal! gqq`/`gww`
fallback, now via `table_align_or_cmd`); `:VimwikiSearch`/`VWS` scoped to the
wiki root; and global `Index`/`TabIndex` entry points. All client-side (no
server change). Both harnesses green (Neovim 299, Vim 291/18/21).