feat(commands): VimwikiTable -nargs=* + Index/TabIndex -count=0 (P3 parity)
Two command-attribute parity fixes (audited against upstream vimwiki master): - VimwikiTable / NuwikiTable were -nargs=1 and called table_insert() with no args, so `:VimwikiTable 4 3` raised E488 and cols/rows were unreachable. All four defs (Vim+Neovim × Vimwiki+Nuwiki) are now -nargs=* and forward <f-args>; the backing table_insert already parsed cols (a:1) + rows (a:2). - VimwikiIndex/TabIndex (and Nuwiki forms) switch from bare -count to upstream's -count=0. Behavior is unchanged (both default count to 0; wiki_index already maps a count to the 1-indexed wiki number) — this just matches the upstream declaration exactly. Tests: cmd.VimwikiTable_passes_cols_and_rows (test-keymaps.lua — asserts a 4-col/3-row table) and cmd.VimwikiTable_accepts_cols_rows (test-keymaps-vim.vim — no E488). gap doc updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -632,6 +632,25 @@ unlet g:_nuwiki_target
|
||||
" follow_link_drop() request mechanism; its end-to-end coverage is the manual
|
||||
" development/start-vim.sh check.
|
||||
|
||||
" ===== :VimwikiTable -nargs=* (cols+rows) =====
|
||||
" Was -nargs=1, which raised E488 on `:VimwikiTable 4 3`. The table insert
|
||||
" itself is an LSP roundtrip (no server in this headless harness), so we only
|
||||
" assert the arg parse succeeds — i.e. no E488 trailing-characters error.
|
||||
call s:set_buf([''])
|
||||
call cursor(1, 1)
|
||||
let s:tbl_err = ''
|
||||
try
|
||||
silent VimwikiTable 4 3
|
||||
catch /E488/
|
||||
let s:tbl_err = v:exception
|
||||
catch
|
||||
" A non-E488 error (e.g. no LSP attached) is expected and fine here.
|
||||
endtry
|
||||
call s:record(
|
||||
\ s:tbl_err ==# '' ? 1 : 0,
|
||||
\ 'cmd.VimwikiTable_accepts_cols_rows',
|
||||
\ 'err=' . s:tbl_err)
|
||||
|
||||
" ===== Wrap up =====
|
||||
|
||||
call add(s:results, '')
|
||||
|
||||
Reference in New Issue
Block a user