feat(commands): VimwikiSplitLink/VSplitLink -nargs=* signature parity (P3)
Upstream's :Vimwiki[V]SplitLink take optional reuse_other_split_window + move_cursor flags (the link is always the one under the cursor); nuwiki's defs took no args, so `:VimwikiSplitLink 0 1` raised E488. All eight defs (both clients × Split/VSplit × Vimwiki/Nuwiki) are now -nargs=*, restoring signature parity for migrated configs/scripts. Documented divergence: the two flags are accepted but not acted on — nuwiki always opens a fresh split and follows in it. Honoring move_cursor/reuse would require threading a completion callback through the async LSP follow path, disproportionate for this rarely-used arg form; the no-arg path (99% case) is fully equivalent. The gap-doc note (which wrongly described the args as a "target link") is corrected. Test: cmd.VimwikiSplitLink_accepts_args (test-keymaps-vim.vim, no E488). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -669,6 +669,26 @@ call s:record(
|
||||
\ 'cmd.VimwikiListChangeLvl_accepts_range_and_args',
|
||||
\ 'err=' . s:lcl_err)
|
||||
|
||||
" ===== :VimwikiSplitLink -nargs=* =====
|
||||
" Upstream takes optional reuse/move-cursor flags; nuwiki's defs took none, so
|
||||
" `:VimwikiSplitLink 0 1` raised E488. Now -nargs=*: assert the arg parse
|
||||
" succeeds. The split opens a window (the follow itself is an LSP no-op here);
|
||||
" collapse back to one window afterward.
|
||||
call s:set_buf(['[[Target]]'])
|
||||
let s:sl_err = ''
|
||||
try
|
||||
silent VimwikiSplitLink 0 1
|
||||
catch /E488/
|
||||
let s:sl_err = v:exception
|
||||
catch
|
||||
" non-E488 (e.g. no LSP attached) is expected and fine here.
|
||||
endtry
|
||||
silent! only
|
||||
call s:record(
|
||||
\ s:sl_err ==# '' ? 1 : 0,
|
||||
\ 'cmd.VimwikiSplitLink_accepts_args',
|
||||
\ 'err=' . s:sl_err)
|
||||
|
||||
" ===== Wrap up =====
|
||||
|
||||
call add(s:results, '')
|
||||
|
||||
Reference in New Issue
Block a user