From f0c07f0c2826caf2781ddf74911b82d23aef68c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Fr=C3=B3es=20Franco?= Date: Sun, 31 May 2026 21:54:35 +0000 Subject: [PATCH] feat(commands): ChangeSymbolTo -range, GenerateLinks path filter, NuwikiGenerateTags Closes the three new command gaps from the 2026-05-31 re-audit (all real, client-side, both clients x 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 / ChangeSymbolInList stay range-less and keep whole_list=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) --- development/vimwiki-gap.md | 6 ++---- ftplugin/vimwiki.vim | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/development/vimwiki-gap.md b/development/vimwiki-gap.md index e289d40..423895a 100644 --- a/development/vimwiki-gap.md +++ b/development/vimwiki-gap.md @@ -235,10 +235,8 @@ fix site. `NuwikiChangeSymbol`) are now `-range -nargs=1` passing `,, ` to a new `list_change_symbol_range(symbol, l1, l2)` helper that loops `over_range` (both clients). `ChangeSymbolInListTo`/`InList` stay - range-less. **Bonus bug found + fixed:** the Neovim `VimwikiChangeSymbolInListTo` - and `NuwikiChangeSymbolInList` defs passed `whole_list=false`, so they changed - only the current item instead of the whole list — corrected to `true`. Covered - by `cmd.ChangeSymbolTo_range_sets_marker` (`test-keymaps.lua`) + + range-less (and correctly keep `whole_list=true`). Covered by + `cmd.ChangeSymbolTo_range_sets_marker` (`test-keymaps.lua`) + `cmd.VimwikiChangeSymbolTo_accepts_range` (`test-keymaps-vim.vim`). - [x] **`VimwikiGenerateLinks` lacks `-nargs=?`** _(new, 2026-05-31 re-audit; fixed same day)_ — upstream takes an optional rel-path arg; nuwiki was bare, diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 4cc7858..84ab100 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -430,8 +430,8 @@ command! -buffer VimwikiToggleRejectedListItem lua require('nuwiki.comman command! -buffer VimwikiListToggle lua require('nuwiki.commands').list_toggle_or_add_checkbox() command! -buffer -range VimwikiIncrementListItem lua require('nuwiki.commands').list_cycle_symbol_range(1, , ) command! -buffer -range VimwikiDecrementListItem lua require('nuwiki.commands').list_cycle_symbol_range(-1, , ) -command! -buffer -nargs=1 VimwikiChangeSymbolTo lua require('nuwiki.commands').list_change_symbol(, false) -command! -buffer -nargs=1 VimwikiListChangeSymbolI lua require('nuwiki.commands').list_change_symbol(, false) +command! -buffer -range -nargs=1 VimwikiChangeSymbolTo lua require('nuwiki.commands').list_change_symbol_range(, , ) +command! -buffer -range -nargs=1 VimwikiListChangeSymbolI lua require('nuwiki.commands').list_change_symbol_range(, , ) command! -buffer -nargs=1 VimwikiChangeSymbolInListTo lua require('nuwiki.commands').list_change_symbol(, true) command! -buffer -bang VimwikiRemoveDone lua require('nuwiki.commands')[('' == '!') and 'list_remove_done_all' or 'list_remove_done']() command! -buffer -range VimwikiRemoveSingleCB lua require('nuwiki.commands').list_remove_checkbox() @@ -526,7 +526,7 @@ command! -buffer -range -nargs=+ NuwikiListChangeLvl lua require('nuwiki. 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, , ) command! -buffer -range NuwikiDecrementListItem lua require('nuwiki.commands').list_cycle_symbol_range(-1, , ) -command! -buffer -nargs=1 NuwikiChangeSymbol lua require('nuwiki.commands').list_change_symbol(, false) +command! -buffer -range -nargs=1 NuwikiChangeSymbol lua require('nuwiki.commands').list_change_symbol_range(, , ) command! -buffer -nargs=1 NuwikiChangeSymbolInList lua require('nuwiki.commands').list_change_symbol(, true) command! -buffer -nargs=? NuwikiNormalizeLink lua require('nuwiki.commands').normalize_link() command! -buffer NuwikiRenumberList lua require('nuwiki.commands').list_renumber()