fix(parity): fifth-pass re-audit — VimwikiGoto nargs, autowriteall, table_auto_fmt
CI / cargo fmt --check (push) Successful in 26s
CI / cargo clippy (push) Successful in 37s
CI / cargo test (push) Successful in 40s
CI / editor keymaps (push) Successful in 1m35s

Closes the actionable fifth-pass findings (gap doc updated):

- VimwikiGoto / NuwikiGoto: -nargs=1 -> -nargs=* in all four defs. Was a
  real bug — `:VimwikiGoto` raised E471, `:VimwikiGoto My Page` raised E488,
  and the handler's empty-arg prompt fallback was unreachable. Both clients
  already prompt on empty, so -nargs=* (keeping -complete=pages) restores
  upstream behavior.

- autowriteall (upstream default ON): while a wiki buffer is current, mirror
  Vim's global 'autowriteall' (auto-save on page switch / :make), restoring
  the prior value on leave. Neovim via ftplugin.lua setup_autowriteall
  (BufEnter/BufLeave) gated by the `autowriteall` setup option; Vim via the
  NuwikiAutoWriteAll augroup gated by g:nuwiki_autowriteall.

- table_auto_fmt (upstream default ON): re-align the table under the cursor
  on InsertLeave. Both clients, gated by `table_auto_fmt` / g:nuwiki_table_auto_fmt,
  guarded on the cursor line containing `|` before the async table_align.

Also logged (no code): VimwikiRenameFile missing -nargs=? (subsumed by the
LSP-rename divergence), table_reduce_last_col, user_htmls, hl_headers/
hl_cb_checked, and a commentstring value-mismatch note. Mappings audit clean.

The Neovim harness disables table_auto_fmt in setup (its async re-align would
perturb the deterministic table-nav keystroke cases); its wiring is verified
on a throwaway scratch buffer instead. Docs (README + doc/nuwiki.txt) updated.
Tests: cmd.VimwikiGoto_accepts_multiword, config.autowriteall_applied,
config.table_auto_fmt_autocmd. Neovim 293, Vim 285/18/21 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 00:59:33 +00:00
parent c161f9d21a
commit 3865b8bf0e
9 changed files with 239 additions and 7 deletions
+9
View File
@@ -265,6 +265,11 @@ require('nuwiki').setup({
-- 'lsp' (server-driven foldingRange, default) | 'expr' (regex) | 'off'.
folding = 'lsp',
-- Mirror Vim's &autowriteall while in a wiki buffer (auto-save on switch).
autowriteall = true,
-- Re-align the table under the cursor on InsertLeave.
table_auto_fmt = true,
-- Broken-link diagnostic severity: 'off' | 'hint' | 'warn' | 'error'.
diagnostic = {
link_severity = 'warn',
@@ -283,6 +288,8 @@ let g:nuwiki_link_severity = 'warn' " 'off'|'hint'|'warn'|'error'
let g:nuwiki_no_default_mappings = 0 " set to 1 to skip the keymap layer
let g:nuwiki_map_prefix = '<Leader>w' " wiki command prefix
let g:nuwiki_no_folding = 0 " set to 1 to skip foldexpr setup
let g:nuwiki_autowriteall = 1 " set to 0 to not touch &autowriteall
let g:nuwiki_table_auto_fmt = 1 " set to 0 to skip InsertLeave table re-align
let g:nuwiki_mouse_mappings = 0 " set to 1 to enable mouse maps
" Drop individual keymap subgroups (mirror the Lua `mappings.<group>` toggles):
" g:nuwiki_no_{wiki_prefix,links,lists,headers,table_editing,diary,html_export,text_objects}_mappings
@@ -300,6 +307,8 @@ let g:nuwiki_mouse_mappings = 0 " set to 1 to enable mouse maps
| `log_level` | string | `'warn'` | `'error'` \| `'warn'` \| `'info'` \| `'debug'` |
| `map_prefix` | string | `'<Leader>w'` | prefix for the wiki command family (`<prefix>w`, `<prefix>t`, `<prefix><Leader>w`, …); mirrors vimwiki's `g:vimwiki_map_prefix`. Vim users set `g:nuwiki_map_prefix` |
| `folding` | string | `'lsp'` | `'lsp'` \| `'expr'` \| `'off'` |
| `autowriteall` | bool | `true` | mirror Vim's `'autowriteall'` while in a wiki buffer (vimwiki `autowriteall`); Vim users set `g:nuwiki_autowriteall` |
| `table_auto_fmt` | bool | `true` | re-align the table under the cursor on `InsertLeave` (vimwiki `table_auto_fmt`); Vim users set `g:nuwiki_table_auto_fmt` |
| `wikis` | list of tables | `nil` | per-wiki tables (see below); wins over the single-wiki shorthand |
| `mappings` | table | all on | keymap subgroups (see below) |
| `diagnostic` | table | `{ link_severity = 'warn' }` | `link_severity`: `'off'` \| `'hint'` \| `'warn'` \| `'error'` |