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 × 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:
+18
-1
@@ -395,7 +395,17 @@ end
|
||||
-- ===== Generation + workspace =====
|
||||
|
||||
M.toc_generate = function() exec('nuwiki.toc.generate', uri_args()) end
|
||||
M.links_generate = function() exec('nuwiki.links.generate', uri_args()) end
|
||||
-- `:VimwikiGenerateLinks [rel_path]` — optional path scopes the links to a
|
||||
-- subtree via the server's generateForPath; no arg = every page.
|
||||
M.links_generate = function(path)
|
||||
if path and path ~= '' then
|
||||
local args = uri_args()[1]
|
||||
args.path = path
|
||||
exec('nuwiki.links.generateForPath', { args })
|
||||
else
|
||||
exec('nuwiki.links.generate', uri_args())
|
||||
end
|
||||
end
|
||||
|
||||
-- range>0 restricts the report to the current buffer's [l1, l2] lines
|
||||
-- (`:'<,'>VimwikiCheckLinks`); otherwise the whole workspace.
|
||||
@@ -574,6 +584,13 @@ function M.list_change_symbol(symbol, whole_list)
|
||||
exec('nuwiki.list.changeSymbol', { args })
|
||||
end
|
||||
|
||||
-- `:[range]VimwikiChangeSymbolTo {sym}` / `:[range]VimwikiListChangeSymbolI {sym}`
|
||||
-- — upstream is -range -nargs=1; a range sets the marker on every list item in
|
||||
-- the selection (single-item when no range, since l1==l2==cursor line).
|
||||
function M.list_change_symbol_range(symbol, l1, l2)
|
||||
over_range(l1, l2, function() M.list_change_symbol(symbol, false) end)
|
||||
end
|
||||
|
||||
function M.list_change_level(delta, whole_subtree)
|
||||
local args = pos_args()[1]
|
||||
args.delta = delta
|
||||
|
||||
Reference in New Issue
Block a user