feat(commands): VimwikiListChangeLvl -range -nargs=+ (P3 parity)
CI / cargo fmt --check (push) Successful in 17s
CI / cargo clippy (push) Successful in 28s
CI / cargo test (push) Successful in 50s
CI / editor keymaps (push) Successful in 1m58s

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:
2026-05-31 20:16:10 +00:00
parent fe116088bb
commit 4710ba03c8
6 changed files with 62 additions and 14 deletions
+4 -4
View File
@@ -87,7 +87,7 @@ if !has('nvim')
command! -buffer -bang VimwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -range VimwikiRemoveSingleCB call nuwiki#commands#list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -nargs=? VimwikiListChangeLvl call nuwiki#commands#list_change_lvl()
command! -buffer -range -nargs=+ VimwikiListChangeLvl call nuwiki#commands#list_change_lvl(<line1>, <line2>, <f-args>)
command! -buffer -nargs=? VimwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
command! -buffer VimwikiRenumberList call nuwiki#commands#list_renumber()
command! -buffer VimwikiRenumberAllLists call nuwiki#commands#list_renumber_all()
@@ -172,7 +172,7 @@ if !has('nvim')
command! -buffer -bang NuwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -range NuwikiRemoveCheckbox call nuwiki#commands#list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -nargs=? NuwikiListChangeLvl call nuwiki#commands#list_change_lvl()
command! -buffer -range -nargs=+ NuwikiListChangeLvl call nuwiki#commands#list_change_lvl(<line1>, <line2>, <f-args>)
command! -buffer NuwikiListToggle call nuwiki#commands#list_toggle_or_add_checkbox()
command! -buffer -range NuwikiIncrementListItem call nuwiki#commands#list_cycle_symbol_range(1, <line1>, <line2>)
command! -buffer -range NuwikiDecrementListItem call nuwiki#commands#list_cycle_symbol_range(-1, <line1>, <line2>)
@@ -435,7 +435,7 @@ command! -buffer -nargs=1 VimwikiChangeSymbolInListTo lua require('nuwiki.comman
command! -buffer -bang VimwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -range VimwikiRemoveSingleCB lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -nargs=? VimwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl()
command! -buffer -range -nargs=+ VimwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl(<line1>, <line2>, <f-args>)
command! -buffer -nargs=? VimwikiNormalizeLink lua require('nuwiki.commands').normalize_link(<args>)
command! -buffer VimwikiRenumberList lua require('nuwiki.commands').list_renumber()
command! -buffer VimwikiRenumberAllLists lua require('nuwiki.commands').list_renumber_all()
@@ -520,7 +520,7 @@ command! -buffer NuwikiTabDropLink lua require('nuwiki.commands').follow_
command! -buffer -bang NuwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -range NuwikiRemoveCheckbox lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -nargs=? NuwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl()
command! -buffer -range -nargs=+ NuwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl(<line1>, <line2>, <f-args>)
command! -buffer NuwikiListToggle lua require('nuwiki.commands').list_toggle_or_add_checkbox()
command! -buffer -range NuwikiIncrementListItem lua require('nuwiki.commands').list_cycle_symbol_range(1, <line1>, <line2>)
command! -buffer -range NuwikiDecrementListItem lua require('nuwiki.commands').list_cycle_symbol_range(-1, <line1>, <line2>)