fix(search): graceful no-match + NuwikiSearch alias (re-audit follow-up)
CI / cargo fmt --check (push) Successful in 28s
CI / cargo clippy (push) Successful in 29s
CI / cargo test (push) Successful in 35s
CI / editor keymaps (push) Successful in 1m25s

Re-audit of the just-landed command work found one real bug I introduced
and a convention gap:

- VimwikiSearch / VWS raised a raw E480 on a no-match search; upstream
  reports it gracefully. Both clients now catch it (try/catch in Vim,
  pcall in Neovim) and emit "nuwiki: no match for <pat>".

- Added a NuwikiSearch alias alongside VimwikiSearch/VWS (every other
  command carries a Nuwiki* form).

Gap-doc note corrected: nuwiki's search populates + opens the location
list (shows all matches) where upstream jumps to the first match — logged
as a minor presentation divergence rather than claiming exact parity.

Config + mappings re-audits came back clean (no new gaps, no regressions;
table-mapping rewire verified non-recursive, gLH/gLL/gLR present).

Tests: cmd.VimwikiSearch_no_match_graceful, surface.{Vimwiki,Nuwiki}Search.
Neovim 301, Vim 294/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 01:28:44 +00:00
parent a11b742fc1
commit 6deba47106
6 changed files with 35 additions and 8 deletions
+8 -4
View File
@@ -269,10 +269,14 @@ fix site.
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`).
list; an empty pattern reuses the last search (`@/`); a no-match is caught and
reported (no raw `E480`). Added a `NuwikiSearch` alias alongside
`VimwikiSearch`/`VWS`. The `-nargs=*` attr fix (2026-06-03) is folded in.
nuwiki uses Vim's `lvimgrep` — the same mechanism vimwiki uses. **Minor
presentation divergence:** nuwiki populates + opens the location list (`/j`,
then `:lopen`) showing all matches, whereas upstream jumps to the first match
and leaves the list closed. 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