feat(commands): VimwikiListChangeLvl -range -nargs=+ (P3 parity)
Upstream is `-range -nargs=+` (change_level(line1, line2, direction, plus_children)); nuwiki was -nargs=? and range-less, so `:1,3VimwikiListChangeLvl increase 0` raised E481/E488 and the level change never spanned a selection. All four defs (Vim+Neovim × Vimwiki+Nuwiki) are now -range -nargs=+ and forward <line1>, <line2>, <f-args>. list_change_lvl(line1, line2, direction, [plus_children]) (both clients) parses the required direction + optional subtree flag and applies the change to every list item in the range via the existing over_range helper. Tests: cmd.ListChangeLvl_range_indents (test-keymaps.lua) + cmd.VimwikiListChangeLvl_accepts_range_and_args (test-keymaps-vim.vim). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -651,6 +651,24 @@ call s:record(
|
||||
\ 'cmd.VimwikiTable_accepts_cols_rows',
|
||||
\ 'err=' . s:tbl_err)
|
||||
|
||||
" ===== :VimwikiListChangeLvl -range -nargs=+ =====
|
||||
" Was -nargs=? (range-less): `:1,3VimwikiListChangeLvl increase 0` raised E481
|
||||
" (no range allowed) and/or E488 (trailing chars). The level change is an LSP
|
||||
" roundtrip (no server here), so assert only the attribute parse: no E481/E488.
|
||||
call s:set_buf(['- a', '- b', '- c'])
|
||||
let s:lcl_err = ''
|
||||
try
|
||||
silent 1,3VimwikiListChangeLvl increase 0
|
||||
catch /E481\|E488/
|
||||
let s:lcl_err = v:exception
|
||||
catch
|
||||
" non-attribute error (e.g. no LSP) is expected and fine here.
|
||||
endtry
|
||||
call s:record(
|
||||
\ s:lcl_err ==# '' ? 1 : 0,
|
||||
\ 'cmd.VimwikiListChangeLvl_accepts_range_and_args',
|
||||
\ 'err=' . s:lcl_err)
|
||||
|
||||
" ===== Wrap up =====
|
||||
|
||||
call add(s:results, '')
|
||||
|
||||
Reference in New Issue
Block a user