feat(links): wire up nuwiki.links.generateForPath (scoped GenerateLinks)
CI / cargo fmt --check (push) Successful in 24s
CI / cargo clippy (push) Successful in 30s
CI / cargo test (push) Successful in 40s
CI / editor keymaps (push) Successful in 1m22s

`:VimwikiGenerateLinks <path>` sent nuwiki.links.generateForPath, but the
server had no handler and didn't advertise it — so the scoped form was
silently dropped (only the no-arg form worked). Register and implement it.

The page list is scoped via page_in_scope: a plain `path` is a directory
subtree (the page itself or anything under `<path>/`); a `path` with `*`/`?`
is a glob pattern (upstream's behaviour), matched with export::glob_match
(now pub(crate)). links_generate and the scoped form share
links_generate_scoped, so cursor-line insertion + captions + config all
apply uniformly.

Tests: page_in_scope unit tests (subtree, glob, prefix-sibling, trailing
slash) + COMMANDS advertises both generate forms. 580 passed, clippy
clean, harnesses green. Doc updated with the [path] argument.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 01:23:42 +00:00
parent f0c51fbfcc
commit daee0f1902
4 changed files with 102 additions and 9 deletions
+5 -3
View File
@@ -529,9 +529,11 @@ Page generation ~
is inserted at the cursor line; an existing one is refreshed in place.
*:NuwikiGenerateLinks*
:NuwikiGenerateLinks
Insert a flat list of every page in the wiki. A new section is inserted at
the cursor line; an existing one is refreshed in place.
:NuwikiGenerateLinks [path]
Insert a flat list of every page in the wiki. With a `path` argument, the
list is scoped to that subtree (a wiki-root-relative directory, or a glob
pattern containing `*`/`?`). A new section is inserted at the cursor line;
an existing one is refreshed in place.
*:NuwikiCheckLinks*
:[range]NuwikiCheckLinks