fix(parity): close the 2026-06-02 re-audit config/command findings
CI / cargo fmt --check (push) Successful in 19s
CI / cargo clippy (push) Successful in 37s
CI / cargo test (push) Successful in 29s
CI / editor keymaps (push) Successful in 1m36s

Implements the remaining fourth-pass findings (gap doc updated):

- list_margin: rework to upstream's buffer-side meaning. Drop the
  nuwiki-only HTML em-margin (renderer field/method + render_page_html
  param removed) and prepend max(0, list_margin) leading spaces to every
  generated bullet in build_toc_text / build_links_text /
  build_tag_links_text / diary::build_index_body; headings stay at col 0.
  From<RawWiki> derives 0 for markdown wikis when unset. Negatives can't
  resolve 'shiftwidth' server-side, so they collapse to zero indent
  (documented divergence).

- diary_months: per-wiki Vec<String> (default 12 English names), threaded
  into the diary-index month labels; missing/empty slots fall back to the
  English name.

- diary_caption_level: widen u8 -> i8 so vimwiki's -1 (min: -1) parses;
  build_index_body clamps < 0 to base tree level 0.

- VimwikiRemoveDone: regain upstream's -range. All four defs are now
  -bang -range, dispatched via remove_done(bang, range, l1, l2) in both
  clients: ! -> whole buffer, explicit range -> new list_remove_done_range
  ({range:[l1-1,l2-1]}), else current list. Server remove_done_edit gained
  an Option<(u32,u32)> range that filters whole-doc victims by start line.

markdown_header_style is deferred: the generators emit vimwiki syntax only
(caption_line never writes markdown headers), so there's no markdown header
to attach the style to. Logged as the "generated-content is vimwiki-only"
intentional divergence pending a later markdown generated-content effort.

Tests: list_margin indent, markdown list_margin-0 default, diary_months
custom + fallback, negative caption_level clamp/parse, ranged remove-done
(server + both keymap harnesses). 553 lsp/core tests pass; clippy clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-02 10:50:38 +00:00
parent 079e7246ac
commit 9441fe918c
19 changed files with 603 additions and 202 deletions
+4 -4
View File
@@ -84,7 +84,7 @@ if !has('nvim')
command! -buffer -range -nargs=1 VimwikiChangeSymbolTo call nuwiki#commands#list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -range -nargs=1 VimwikiListChangeSymbolI call nuwiki#commands#list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo call nuwiki#commands#list_change_symbol(<q-args>, 1)
command! -buffer -bang VimwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -bang -range VimwikiRemoveDone call nuwiki#commands#remove_done(<bang>0, <range>, <line1>, <line2>)
command! -buffer -range VimwikiRemoveSingleCB call nuwiki#commands#list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -range -nargs=+ VimwikiListChangeLvl call nuwiki#commands#list_change_lvl(<line1>, <line2>, <f-args>)
@@ -170,7 +170,7 @@ if !has('nvim')
command! -buffer Nuwiki2HTMLBrowse call nuwiki#commands#export_browse()
command! -buffer -bang NuwikiAll2HTML if <bang>0 | call nuwiki#commands#export_all_force() | else | call nuwiki#commands#export_all() | endif
command! -buffer -bang NuwikiRemoveDone if <bang>0 | call nuwiki#commands#list_remove_done_all() | else | call nuwiki#commands#list_remove_done() | endif
command! -buffer -bang -range NuwikiRemoveDone call nuwiki#commands#remove_done(<bang>0, <range>, <line1>, <line2>)
command! -buffer -range NuwikiRemoveCheckbox call nuwiki#commands#list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList call nuwiki#commands#list_remove_checkbox_in_list()
command! -buffer -range -nargs=+ NuwikiListChangeLvl call nuwiki#commands#list_change_lvl(<line1>, <line2>, <f-args>)
@@ -433,7 +433,7 @@ command! -buffer -range VimwikiDecrementListItem lua require('nuwiki.c
command! -buffer -range -nargs=1 VimwikiChangeSymbolTo lua require('nuwiki.commands').list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -range -nargs=1 VimwikiListChangeSymbolI lua require('nuwiki.commands').list_change_symbol_range(<q-args>, <line1>, <line2>)
command! -buffer -nargs=1 VimwikiChangeSymbolInListTo lua require('nuwiki.commands').list_change_symbol(<q-args>, true)
command! -buffer -bang VimwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -bang -range VimwikiRemoveDone lua require('nuwiki.commands').remove_done('<bang>' == '!', <range>, <line1>, <line2>)
command! -buffer -range VimwikiRemoveSingleCB lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer VimwikiRemoveCBInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -range -nargs=+ VimwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl(<line1>, <line2>, <f-args>)
@@ -519,7 +519,7 @@ command! -buffer -nargs=* NuwikiSplitLink split | lua require('nuwiki.c
command! -buffer -nargs=* NuwikiVSplitLink vsplit | lua require('nuwiki.commands').follow_link_or_create()
command! -buffer NuwikiTabnewLink tabnew | lua require('nuwiki.commands').follow_link_or_create()
command! -buffer NuwikiTabDropLink lua require('nuwiki.commands').follow_link_drop()
command! -buffer -bang NuwikiRemoveDone lua require('nuwiki.commands')[('<bang>' == '!') and 'list_remove_done_all' or 'list_remove_done']()
command! -buffer -bang -range NuwikiRemoveDone lua require('nuwiki.commands').remove_done('<bang>' == '!', <range>, <line1>, <line2>)
command! -buffer -range NuwikiRemoveCheckbox lua require('nuwiki.commands').list_remove_checkbox()
command! -buffer NuwikiRemoveCheckboxInList lua require('nuwiki.commands').list_remove_checkbox_in_list()
command! -buffer -range -nargs=+ NuwikiListChangeLvl lua require('nuwiki.commands').list_change_lvl(<line1>, <line2>, <f-args>)