feat(parity): P3 quick-wins — ShowVersion, gLH/gLL/gLR, Search/Align nargs
CI / cargo fmt --check (push) Successful in 21s
CI / cargo clippy (push) Successful in 26s
CI / cargo test (push) Successful in 36s
CI / editor keymaps (push) Successful in 1m47s

Closes four low-risk P3 parity items (gap doc updated):

- VimwikiShowVersion / NuwikiShowVersion: new global command (both clients)
  echoing g:nuwiki_version (0.1.0) + the host editor, via
  nuwiki#commands#show_version / commands.show_version.

- gLH / gLL / gLR: upstream's case-variant aliases of gLh/gLl/gLr (dedent /
  indent whole item, renumber all lists) added in both clients.

- VimwikiSearch / VWS: -nargs=1 -> -nargs=* (Vim + Neovim), so a multi-word
  search no longer raises E488 and an empty invocation reuses the last search
  pattern. (The lvimgrep-vs-vimwiki-engine difference stays open.)

- VimwikiTableAlignQ / AlignW / NuwikiTableAlign: bare -> -nargs=?, so
  `:VimwikiTableAlignQ 2` no longer raises E488 (optional column arg is
  accepted-and-ignored; the gqq-align vs gww-align-without-resize split
  stays open).

Docs (doc/nuwiki.txt + README) updated for the command and the aliases.
Tests: surface.{Vimwiki,Nuwiki}ShowVersion, map[n].gL{H,L,R} (both
harnesses), cmd.search_and_tablealign_nargs (vim). Neovim 291, Vim
282/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 00:28:51 +00:00
parent 9441fe918c
commit c161f9d21a
11 changed files with 114 additions and 30 deletions
+24 -1
View File
@@ -112,7 +112,7 @@ let s:both_forms = [
\ 'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
\ 'NormalizeLink', 'RenumberList', 'RenumberAllLists',
\ 'ListToggle', 'IncrementListItem', 'DecrementListItem',
\ 'CatUrl',
\ 'CatUrl', 'ShowVersion',
\ ]
for s:suffix in s:both_forms
for s:prefix in ['Nuwiki', 'Vimwiki']
@@ -189,6 +189,7 @@ let s:mapping_surface = [
\ ['<C-Space>', 'nx'], ['<C-@>', 'nx'], ['<Nul>', 'nx'],
\ ['gnt', 'n'], ['gln', 'nx'], ['glp', 'nx'], ['glx', 'nx'],
\ ['glh', 'n'], ['gll', 'n'], ['gLh', 'n'], ['gLl', 'n'],
\ ['gLH', 'n'], ['gLL', 'n'], ['gLR', 'n'],
\ ['glr', 'n'], ['gLr', 'n'], ['gl', 'n'], ['gL', 'n'],
\ ['gl-', 'n'], ['gL-', 'n'], ['gl*', 'n'], ['gL*', 'n'],
\ ['gl#', 'n'], ['gL#', 'n'], ['gl1', 'n'], ['gL1', 'n'],
@@ -669,6 +670,28 @@ call s:record(
\ 'cmd.VimwikiListChangeLvl_accepts_range_and_args',
\ 'err=' . s:lcl_err)
" ===== :VimwikiSearch / VWS -nargs=* + :VimwikiTableAlignQ/W -nargs=? =====
" Upstream attributes: Search/VWS take -nargs=* (was -nargs=1, so a multi-word
" `:VimwikiSearch foo bar` raised E488); TableAlignQ/W take -nargs=? (were bare,
" so `:VimwikiTableAlignQ 2` raised E488). lvimgrep/align run for real here, so
" swallow any non-attribute error and assert only that E488 is gone.
let s:attr_err = ''
try
silent! VimwikiSearch foo bar
silent! VWS foo bar
silent! VimwikiTableAlignQ 2
silent! VimwikiTableAlignW 2
silent! NuwikiTableAlign 2
catch /E488/
let s:attr_err = v:exception
catch
" runtime errors (no match, empty table, …) are expected and fine here.
endtry
call s:record(
\ s:attr_err ==# '' ? 1 : 0,
\ 'cmd.search_and_tablealign_nargs',
\ 'err=' . s:attr_err)
" ===== :VimwikiRemoveDone -bang -range =====
" Upstream is `-range`; nuwiki had `-bang` only, so `:'<,'>VimwikiRemoveDone`
" raised E481. Now `-bang -range`: a ranged invocation must parse (no E481),
+3 -1
View File
@@ -139,7 +139,7 @@ vim.defer_fn(function()
'RebuildTags', '2HTML', '2HTMLBrowse', 'All2HTML', 'Rss',
'NormalizeLink', 'RenumberList', 'RenumberAllLists',
'ListToggle', 'IncrementListItem', 'DecrementListItem',
'CatUrl',
'CatUrl', 'ShowVersion',
}
for _, suffix in ipairs(both_forms) do
for _, prefix in ipairs({ 'Nuwiki', 'Vimwiki' }) do
@@ -212,6 +212,8 @@ vim.defer_fn(function()
{ '<C-Space>', 'nx' }, { '<C-@>', 'nx' }, { '<Nul>', 'nx' },
{ 'gnt', 'n' }, { 'gln', 'nx' }, { 'glp', 'nx' }, { 'glx', 'nx' },
{ 'glh', 'n' }, { 'gll', 'n' }, { 'gLh', 'n' }, { 'gLl', 'n' },
-- Upstream case-variant aliases of gLh/gLl/gLr.
{ 'gLH', 'n' }, { 'gLL', 'n' }, { 'gLR', 'n' },
{ 'glr', 'n' }, { 'gLr', 'n' }, { 'gl', 'n' }, { 'gL', 'n' },
{ 'gl-', 'n' }, { 'gL-', 'n' }, { 'gl*', 'n' }, { 'gL*', 'n' },
{ 'gl#', 'n' }, { 'gL#', 'n' }, { 'gl1', 'n' }, { 'gL1', 'n' },
+25 -12
View File
@@ -173,12 +173,20 @@ fix site.
### Commands
- [ ] `VimwikiVar` — config-var get/set introspection. _Fix:_ `plugin/nuwiki.vim`.
- [ ] `VimwikiShowVersion` — print version (trivial). _Fix:_ `plugin/nuwiki.vim`.
- [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 lost. _(Re-audit 2026-05-31:
also note the attr differs — both are defined bare in all four contexts vs
upstream's `-nargs=?`, so `:VimwikiTableAlignQ 2` raises E488.)_
(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] `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
@@ -224,9 +232,13 @@ 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.
_(Re-audit 2026-05-31: also `-nargs=1` in all four contexts vs upstream
`-nargs=*`.)_
- [ ] `: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] **`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
@@ -476,11 +488,12 @@ fix site.
### Mappings
- [ ] Visual `<CR>` normalize-link (visual `+` covers the same intent).
- [ ] Insert `<S-CR>` multiline list item.
- [ ] `gLH` / `gLL` / `gLR` — upstream binds these as case-variant **aliases**
of `gLh` / `gLl` / `gLr` (same actions: dedent / indent whole item, renumber
all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki has the
lowercase forms but not the uppercase-suffix aliases. Cosmetic — same effect,
redundant keys.
- [x] **`gLH` / `gLL` / `gLR`** _(fixed 2026-06-03)_ — upstream binds these as
case-variant **aliases** of `gLh` / `gLl` / `gLr` (dedent / indent whole item,
renumber all lists; upstream `ftplugin/vimwiki.vim:553,555,561`). nuwiki had
only the lowercase forms. _Fix:_ added the uppercase-suffix aliases (same
actions) in both clients (`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`).
Covered by `map[n].gL{H,L,R}` in both harnesses.
- [x] **`<D-CR>` (Cmd+Return) tab-drop alias** _(new, 2026-05-31 re-audit)_
added `<D-CR>``follow_link_drop` alongside `<C-S-CR>` in both clients
(`lua/nuwiki/keymaps.lua`, `ftplugin/vimwiki.vim`); docs updated. Covered by