fix(review): close all 2026-06-03 codebase-review findings (R1-R18)
CI / cargo fmt --check (push) Successful in 20s
CI / cargo clippy (push) Successful in 32s
CI / cargo test (push) Successful in 38s
CI / editor keymaps (push) Successful in 1m33s

Resolves the 18 findings from the parallel codebase review, tracked in
development/vimwiki-gap.md.

Correctness / perf:
- Wiki.config -> Arc<WikiConfig> so cloning a Wiki is a refcount bump (R5)
- WorkspaceIndex::remove is no longer O(n^2): a per-source contributions
  map limits the scan to buckets the source actually wrote into (R6)
- render_color now expands color_tag_template (__STYLE__/__CONTENT__),
  consuming the previously-dead field; ColorNode documented as an
  extension point; 3 renderer tests added (R3/R4)
- wiki_root_for returns empty/nil on no-match instead of falling back to
  the first wiki (R2); auto_header honours links_space_char (R7)

Cleanup / dedup:
- Remove dead #[allow(dead_code)] stubs + uncalled pub helpers, narrow
  imports (R10/R11)
- Dedup span_of_inline x3 -> InlineNode::span() (R12)
- diary_step single read lock; page_captions single pass (R13)
- Lua auto_header loop -> wiki_list(); detect_current_symbol cleanup
  (R14/R18)

Client / docs:
- :VimwikiNormalizeLink Vim cmds -> <q-args> (R17); ftplugin header fix
  (R16); vars.vim multi-wiki limitation documented (R15)
- Document 19 config options in README.md + doc/nuwiki.txt; fix
  list_margin/shiftwidth doc and stale comments (R1/R9)
- R8 investigated, confirmed not a real bug (documented)

Verified: Neovim harness 307, Vim harness 301/18/21, Rust suite 568, all
0 failed; clippy clean; fresh parallel-agent audit found no regressions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 14:13:55 +00:00
parent e319b4a935
commit 3b92b11948
25 changed files with 410 additions and 236 deletions
+55 -2
View File
@@ -178,6 +178,23 @@ plugin: >
`diagnostic.link_severity` `'warn'`
Severity of broken-link diagnostics: `off`, `hint`, `warn`, `error`.
*g:nuwiki_auto_chdir*
`auto_chdir` false
`:lcd` into the owning wiki's root when a wiki buffer becomes current.
Mirrors vimwiki's `auto_chdir`. Vim users set |g:nuwiki_auto_chdir|.
*g:nuwiki_auto_header*
`auto_header` false
Insert a level-1 header derived from the filename on new (empty) wiki
pages. Honours `links_space_char` (so `My_Page.wiki` → `= My Page =`).
Mirrors vimwiki's `auto_header`. Vim users set |g:nuwiki_auto_header|.
*g:nuwiki_no_calendar*
`use_calendar` true
When true (default), wire up calendar-vim integration if it is on the
runtimepath (`g:calendar_action` / `g:calendar_sign`). Set to false, or
define |g:nuwiki_no_calendar| before setup(), to opt out.
Per-wiki options ~
Every option in this list lives on a `wikis[i] = {...}` entry. Defaults
@@ -197,6 +214,22 @@ match upstream vimwiki.
`diary_caption_level` `0`
`diary_sort` `'desc'` | `'asc'`
`diary_header` `'Diary'`
`diary_months` English month names — month-number → display name
used in the diary index headings.
`create_link` `true` — create the target page when following a link
to a missing page; `false` makes the follow a no-op.
`dir_link` `''` — index stem opened when following a link to a
directory (e.g. `'index'`); empty opens the directory.
`bullet_types` `['-', '*', '#']` — unordered-bullet glyphs for this
wiki; drives `cycle_bullets`.
`cycle_bullets` `false` — rotate an unordered item's glyph through
`bullet_types` as it is indented/dedented.
`generated_links_caption` `false` — emit `[[page|Heading]]` (first heading as
caption) from `:VimwikiGenerateLinks`.
`toc_link_format` `0` — `0` = `[[#anchor|title]]` (with description);
`1` = `[[#anchor]]` (anchor only).
`table_reduce_last_col` `false` — don't pad the last table column to fill;
keep it at its minimum width.
`html_path` Path for `:Vimwiki2HTML` output.
`template_path` Path holding `<name>.tpl` templates.
`template_default` `'default'`
@@ -206,6 +239,23 @@ match upstream vimwiki.
`html_filename_parameterization` `false` — encode subdir paths into the HTML
filename instead of nesting directories.
`color_dic` `{}` — map of `{ name = 'color' }` for `:NuwikiColorize`.
`color_tag_template` `'<span style="__STYLE__">__CONTENT__</span>'` — HTML
emitted for a `color_dic` colour span. `__STYLE__` →
`color:<css>`, `__CONTENT__` → the rendered inner HTML.
`valid_html_tags` `'b,i,s,u,sub,sup,kbd,br,hr,div,center,strong,em'` —
comma-separated inline HTML tags passed through export
unescaped (`span` is always allowed for colour spans).
`emoji_enable` `true` — substitute `:alias:` emoji shortcodes with
their glyph during HTML export.
`text_ignore_newline` `true` — a single newline inside a paragraph renders
as a space in HTML; `false` emits `<br>`.
`list_ignore_newline` `true` — a single newline inside a list item renders
as a space in HTML; `false` emits `<br>`.
`rss_name` `'rss.xml'` — filename of the generated diary RSS feed,
relative to `html_path`.
`rss_max_items` `10` — cap on the number of diary items in the RSS feed.
`user_htmls` `{}` — basenames of HTML files with no wiki source that
`:VimwikiAll2HTML` must not prune.
`custom_wiki2html` `''` — external converter command. When set, export
shells out to it instead of the built-in renderer,
called as: <cmd> <force> <syntax> <ext> <out_dir>
@@ -231,8 +281,11 @@ match upstream vimwiki.
`listsyms` `' .oOX'` — checkbox progression characters.
`listsym_rejected` `'-'` — glyph for a cancelled checkbox `[-]`.
`listsyms_propagate` `true`
`list_margin` `-1` — spaces before a list bullet; `-1` follows
`shiftwidth`.
`list_margin` `-1` — spaces before a generated list bullet (TOC /
generated links). `-1` means "no extra margin": the
server can't read the editor's `shiftwidth`, so it
clamps negative values to `0`. Set a non-negative
number to force a fixed indent.
`links_space_char` `' '`
Code fences tagged with a language (`{{{python …}}}`) are highlighted with