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
+2
View File
@@ -95,6 +95,7 @@ if !has('nvim')
command! -buffer VimwikiPrevLink call nuwiki#commands#link_prev()
command! -buffer VimwikiBaddLink call nuwiki#commands#badd_link()
command! -buffer -nargs=* VimwikiSearch call nuwiki#commands#search(<q-args>)
command! -buffer -nargs=* NuwikiSearch call nuwiki#commands#search(<q-args>)
command! -buffer -nargs=* VWS call nuwiki#commands#search(<q-args>)
command! -buffer -nargs=* -complete=customlist,nuwiki#complete#pages VimwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
@@ -450,6 +451,7 @@ command! -buffer -nargs=* -complete=customlist,nuwiki#complete#pages VimwikiGoto
command! -buffer VimwikiBacklinks lua vim.lsp.buf.references()
command! -buffer VWB lua vim.lsp.buf.references()
command! -buffer -nargs=* VimwikiSearch lua require('nuwiki.commands').search(<q-args>)
command! -buffer -nargs=* NuwikiSearch lua require('nuwiki.commands').search(<q-args>)
command! -buffer -nargs=* VWS lua require('nuwiki.commands').search(<q-args>)
command! -buffer VimwikiDeleteFile lua require('nuwiki.commands').delete_file()