fix(parity): fifth-pass re-audit — VimwikiGoto nargs, autowriteall, table_auto_fmt
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:
@@ -255,6 +255,34 @@ vim.defer_fn(function()
|
||||
end
|
||||
end
|
||||
|
||||
-- ===== Config-driven buffer behaviors =====
|
||||
-- autowriteall (default on) mirrors into Vim's global 'autowriteall' while
|
||||
-- the wiki buffer is current.
|
||||
record(vim.o.autowriteall == true, 'config.autowriteall_applied',
|
||||
vim.o.autowriteall and '' or 'autowriteall not set on the wiki buffer')
|
||||
-- table_auto_fmt wiring: with the option enabled, attaching a buffer
|
||||
-- registers a buffer-local InsertLeave autocmd. (It's off in the harness
|
||||
-- setup so the async re-align doesn't perturb the table-nav cases below, so
|
||||
-- verify on a throwaway scratch buffer in its own window.)
|
||||
do
|
||||
local cfg = require('nuwiki.config')
|
||||
cfg.options.table_auto_fmt = true
|
||||
vim.cmd('new')
|
||||
local sbuf = vim.api.nvim_get_current_buf()
|
||||
require('nuwiki.ftplugin').attach(sbuf)
|
||||
local found = false
|
||||
for _, a in ipairs(vim.api.nvim_get_autocmds({ event = 'InsertLeave', buffer = sbuf })) do
|
||||
if a.group_name and a.group_name:match('^nuwiki_taf_') then
|
||||
found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
record(found, 'config.table_auto_fmt_autocmd',
|
||||
found and '' or 'attach did not register the InsertLeave autocmd when enabled')
|
||||
cfg.options.table_auto_fmt = false
|
||||
vim.cmd('bwipeout!')
|
||||
end
|
||||
|
||||
-- ===== Lists =====
|
||||
|
||||
run('list.toggle_via_C-Space', {
|
||||
|
||||
Reference in New Issue
Block a user