fix(diary): complete the -count wiki selector (repair 874bdd0)
CI / cargo fmt --check (push) Successful in 30s
CI / cargo clippy (push) Successful in 38s
CI / cargo test (push) Successful in 40s
CI / editor keymaps (push) Successful in 1m37s

874bdd0 committed the diary -count feature with several Edits that had
silently no-matched, leaving the tree non-compiling and the clients
inconsistent (CI run 236 failed). This completes it:

- commands.rs: add the `wiki` field to OptionalUriArg (the previous edit
  targeted a wrong struct name) and pass None to the six resolve_diary_wiki
  callers that take no selector (date/list/step paths). Server builds clean.
- autoload/nuwiki/commands.vim + lua/nuwiki/commands.lua: actually thread the
  count through s:diary_open / _diary_open and the diary_today/today_tab/
  yesterday/tomorrow/index handlers (these edits had failed before, so the
  ftplugin defs were calling handlers that ignored/rejected the arg).
- Add the test cases the prior commit referenced but never landed:
  cmd.VimwikiMakeDiaryNote_has_count (test-keymaps.lua) +
  cmd.Vimwiki{MakeDiaryNote,DiaryIndex}_accepts_count (test-keymaps-vim.vim).
- Fix the OptUriArg→OptionalUriArg name in the gap-doc note.

Verified with CI flags: workspace test/clippy/fmt clean; lua 284, vim 272/18/21,
all 0 failed; the three new diary cases pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 22:25:08 +00:00
parent 874bdd0c02
commit 2da2168d88
5 changed files with 52 additions and 26 deletions
+2 -2
View File
@@ -304,8 +304,8 @@ fix site.
same day)_ — upstream's `:Vimwiki{Make,TabMake,MakeYesterday,MakeTomorrow}DiaryNote`
+ `VimwikiDiaryIndex` (and the `Nuwiki*` forms) carry `-count=0`, where the
count selects the wiki number. _Fix:_ a real wiki selector end-to-end —
- Server (`commands.rs`): `OptUriArg` gained an optional `wiki` selector and
`resolve_diary_wiki(backend, uri, wiki)` now prefers it (via the existing
- Server (`commands.rs`): `OptionalUriArg` gained an optional `wiki` selector
and `resolve_diary_wiki(backend, uri, wiki)` now prefers it (via the existing
`resolve_wiki_selector`, reused — accepts a 0-indexed number) over the
buffer URI; used by `diary_open_relative` + `diary_open_index`.
- Clients: `s:diary_open`/`diary_open` (both clients) and