feat: real range/bang/visual handling for the deferred command gaps
Implements the four items previously left as "needs handler work" — all
fully wired, not cosmetic.
- ToggleListItem / IncrementListItem / DecrementListItem are now -range
(both clients). The client loops the per-line op over [<line1>,<line2>]
(toggle_list_item_range / list_cycle_symbol_range). The server's edits are
version-less single-line WorkspaceEdits, so each line applies independently
— no server protocol change. `:'<,'>VimwikiToggleListItem` toggles the whole
selection.
- VimwikiRebuildTags gains -bang: `:…RebuildTags!` passes { all: true } and
the server (tags_rebuild) re-indexes every configured wiki via
wikis_snapshot(), not just the current one.
- VimwikiNormalizeLink is -nargs=?: with `1` (upstream's visual flag; the
x-mode `+` mapping now passes it) it wraps the '< / '> selection as
[[selection]] (new wrap_visual_as_wikilink in both clients).
- VimwikiCheckLinks is -range: a ranged invocation filters the broken-link
report to the current buffer's selected lines (client-side filter in
results_to_qf / check_links).
Tests: cmd.toggle_list_item_range + cmd.normalize_link_visual_wraps_selection
(test-keymaps.lua), normalize.visual_wraps_selection (test-keymaps-vim.vim).
README + doc/nuwiki.txt + gap doc updated. fmt/clippy clean; nvim 274,
vim 266+18, all Rust tests + config-parity green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -577,6 +577,17 @@ call s:record(
|
||||
\ 'err=' . s:cz_e . ' real=' . synconcealed(3, 1)[0]
|
||||
\ . ' rgb=' . synconcealed(2, stridx(getline(2), '<span') + 1)[0])
|
||||
|
||||
" ===== NormalizeLink visual wraps the selection (pure-VimL) =====
|
||||
" `:VimwikiNormalizeLink 1` / the x-mode `+` wrap the `'<`/`'>` selection.
|
||||
call s:set_buf(['one two three'])
|
||||
call cursor(1, 5)
|
||||
call feedkeys("viw\<Esc>", 'tx')
|
||||
call nuwiki#commands#normalize_link(1)
|
||||
call s:record(
|
||||
\ getline(1) ==# 'one [[two]] three' ? 1 : 0,
|
||||
\ 'normalize.visual_wraps_selection',
|
||||
\ 'got ' . string(getline(1)))
|
||||
|
||||
" ===== Follow-link resolves + opens in the current window (regression) =====
|
||||
" follow_link_or_create() must resolve the definition itself and `:edit` the
|
||||
" target in the CURRENT window — including a page that does not exist yet
|
||||
|
||||
Reference in New Issue
Block a user