Files
nuwiki/autoload/vimwiki
gffranco 30cccd88bd
CI / cargo fmt --check (push) Successful in 26s
CI / cargo clippy (push) Successful in 32s
CI / cargo test (push) Successful in 29s
CI / editor keymaps (push) Successful in 1m23s
fix(vars): resolve wiki by index in the vimwiki compat shim (R15)
`vimwiki#vars#get_wikilocal(key, N)` previously ignored the wiki-index
argument and always read the scalar `g:nuwiki_*` globals (the first
wiki), so third-party plugins (vimwiki-sync, vim-zettel) got the wrong
wiki's path/ext/syntax in a multi-wiki setup.

Now:
- an explicit numeric index selects that wiki from `g:nuwiki_wikis[N]`,
  falling back per-key to the scalar globals;
- with no index, the wiki owning the current buffer is resolved (matching
  upstream's `g:vimwiki_current_idx` behaviour);
- an out-of-range index clamps to the first wiki.

The single-wiki shorthand path is unchanged. Verified with a headless
Vim test (by-index, global fallback, clamp, no-arg, shorthand) and the
Vim keymap harness (301/18/21, 0 failed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 14:20:14 +00:00
..