feat(commands): ChangeSymbolTo -range, GenerateLinks path filter, NuwikiGenerateTags
CI / cargo fmt --check (push) Successful in 29s
CI / cargo clippy (push) Successful in 34s
CI / cargo test (push) Successful in 45s
CI / editor keymaps (push) Failing after 1m43s

Closes the three new command gaps from the 2026-05-31 re-audit (all real,
client-side, both clients × Vimwiki/Nuwiki):

- VimwikiChangeSymbolTo / ListChangeSymbolI / NuwikiChangeSymbol are now
  -range -nargs=1 via a new list_change_symbol_range(symbol,l1,l2) helper that
  loops over_range; was -nargs=1 only → E481 on a visual selection.
  ChangeSymbolInListTo/InList stay range-less.
  Bonus: the Neovim VimwikiChangeSymbolInListTo + NuwikiChangeSymbolInList defs
  passed whole_list=false, changing only the current item — corrected to true.

- VimwikiGenerateLinks / NuwikiGenerateLinks are now -nargs=?; with an arg the
  client dispatches the existing server command nuwiki.links.generateForPath
  ({path}) for real subtree-scoped link generation, else nuwiki.links.generate.
  Was bare → E488 on an arg.

- Added NuwikiGenerateTags (Vim + Neovim) mirroring VimwikiGenerateTags, with
  -nargs=? -complete=…tags — closes the :Vimwiki*↔:Nuwiki* alias asymmetry.

Tests: cmd.ChangeSymbolTo_range_sets_marker, cmd.GenerateLinks_accepts_optional_path,
cmd.NuwikiGenerateTags_exists (test-keymaps.lua, 283 pass) +
cmd.VimwikiChangeSymbolTo_accepts_range, cmd.VimwikiGenerateLinks_accepts_path,
cmd.NuwikiGenerateTags_exists (test-keymaps-vim.vim, 272/18/21). fmt clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 21:48:31 +00:00
parent 773bbdb6a6
commit f616915581
5 changed files with 105 additions and 27 deletions
+9 -7
View File
@@ -81,8 +81,8 @@ if !has('nvim')
command! -buffer VimwikiListToggle call nuwiki#commands#list_toggle_or_add_checkbox()
command! -buffer -range VimwikiIncrementListItem call nuwiki#commands#list_cycle_symbol_range(1, <line1>, <line2>)
command! -buffer -range VimwikiDecrementListItem call nuwiki#commands#list_cycle_symbol_range(-1, <line1>, <line2>)
command! -buffer -nargs=1 VimwikiChangeSymbolTo call nuwiki#commands#list_change_symbol(<q-args>, 0)
command! -buffer -nargs=1 VimwikiListChangeSymbolI call nuwiki#commands#list_change_symbol(<q-args>, 0)
command! -buffer -range -nargs=1 VimwikiChangeSymbolTo call nuwiki#commands#list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -range -nargs=1 VimwikiListChangeSymbolI call nuwiki#commands#list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo call nuwiki#commands#list_change_symbol(<q-args>, 1)
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()
@@ -100,7 +100,7 @@ if !has('nvim')
command! -buffer VimwikiRss call nuwiki#commands#export_rss()
command! -buffer VimwikiTOC call nuwiki#commands#toc_generate()
command! -buffer VimwikiGenerateLinks call nuwiki#commands#links_generate()
command! -buffer -nargs=? VimwikiGenerateLinks call nuwiki#commands#links_generate(<q-args>)
command! -buffer -range VimwikiCheckLinks call nuwiki#commands#check_links(<range>, <line1>, <line2>)
command! -buffer VimwikiFindOrphans call nuwiki#commands#find_orphans()
@@ -145,12 +145,13 @@ if !has('nvim')
command! -buffer -bang NuwikiExportAll if <bang>0 | call nuwiki#commands#export_all_force() | else | call nuwiki#commands#export_all() | endif
command! -buffer NuwikiRss call nuwiki#commands#export_rss()
command! -buffer NuwikiTOC call nuwiki#commands#toc_generate()
command! -buffer NuwikiGenerateLinks call nuwiki#commands#links_generate()
command! -buffer -nargs=? NuwikiGenerateLinks call nuwiki#commands#links_generate(<q-args>)
command! -buffer -range NuwikiCheckLinks call nuwiki#commands#check_links(<range>, <line1>, <line2>)
command! -buffer NuwikiFindOrphans call nuwiki#commands#find_orphans()
command! -buffer -bang NuwikiRebuildTags call nuwiki#commands#tags_rebuild(<bang>0)
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiSearchTags call nuwiki#commands#tags_search(<q-args>)
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiGenerateTagLinks call nuwiki#commands#tags_generate_links(<q-args>)
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiGenerateTags call nuwiki#commands#tags_generate_links(<q-args>)
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages NuwikiGoto call nuwiki#commands#wiki_goto_page(<q-args>)
" Canonical :Nuwiki* names that mirror the documented surface.
@@ -176,7 +177,7 @@ if !has('nvim')
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>)
command! -buffer -nargs=1 NuwikiChangeSymbol call nuwiki#commands#list_change_symbol(<q-args>, 0)
command! -buffer -range -nargs=1 NuwikiChangeSymbol call nuwiki#commands#list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -nargs=1 NuwikiChangeSymbolInList call nuwiki#commands#list_change_symbol(<q-args>, 1)
command! -buffer -nargs=? NuwikiNormalizeLink call nuwiki#commands#normalize_link(<args>)
command! -buffer NuwikiRenumberList call nuwiki#commands#list_renumber()
@@ -448,7 +449,7 @@ command! -buffer -bang VimwikiAll2HTML execute (<bang>0 ? "lua require('nuwi
command! -buffer VimwikiRss lua require('nuwiki.commands').export_rss()
command! -buffer VimwikiTOC lua require('nuwiki.commands').toc_generate()
command! -buffer VimwikiGenerateLinks lua require('nuwiki.commands').links_generate()
command! -buffer -nargs=? VimwikiGenerateLinks lua require('nuwiki.commands').links_generate(<q-args>)
command! -buffer -range VimwikiCheckLinks lua require('nuwiki.commands').check_links(<range>, <line1>, <line2>)
command! -buffer VimwikiFindOrphans lua require('nuwiki.commands').find_orphans()
@@ -489,12 +490,13 @@ command! -buffer NuwikiExportBrowse lua require('nuwiki.commands').
command! -buffer -bang NuwikiExportAll execute (<bang>0 ? "lua require('nuwiki.commands').export_all_force()" : "lua require('nuwiki.commands').export_all()")
command! -buffer NuwikiRss lua require('nuwiki.commands').export_rss()
command! -buffer NuwikiTOC lua require('nuwiki.commands').toc_generate()
command! -buffer NuwikiGenerateLinks lua require('nuwiki.commands').links_generate()
command! -buffer -nargs=? NuwikiGenerateLinks lua require('nuwiki.commands').links_generate(<q-args>)
command! -buffer -range NuwikiCheckLinks lua require('nuwiki.commands').check_links(<range>, <line1>, <line2>)
command! -buffer NuwikiFindOrphans lua require('nuwiki.commands').find_orphans()
command! -buffer -bang NuwikiRebuildTags lua require('nuwiki.commands').tags_rebuild('<bang>' == '!')
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiSearchTags lua require('nuwiki.commands').tags_search(<q-args>)
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiGenerateTagLinks lua require('nuwiki.commands').tags_generate_links(<q-args>)
command! -buffer -nargs=? -complete=customlist,nuwiki#complete#tags NuwikiGenerateTags lua require('nuwiki.commands').tags_generate_links(<q-args>)
command! -buffer -nargs=1 -complete=customlist,nuwiki#complete#pages NuwikiGoto lua require('nuwiki.commands').wiki_goto_page(<q-args>)
" Canonical :Nuwiki* names that mirror the documented surface.