fix(lists): VimwikiToggleRejectedListItem -range parity (P3)
Upstream's :VimwikiToggleRejectedListItem is -range and binds glx in visual mode; nuwiki's four defs were bare, so a ranged invocation raised E481 and acted cursor-only. Same -range class already fixed for ToggleListItem/Increment/Decrement -- ToggleRejected was missed. All four defs (Vim+Neovim x Vimwiki*/Nuwiki*) are now -range, routed through a new reject_list_item_range(l1, l2) looping over_range in both clients, mirroring toggle_list_item_range. Visual glx stays cursor-only, consistent with its <C-Space>/gln/glp siblings. Also logs the 2026-06-02 re-audit findings in development/vimwiki-gap.md: RemoveDone lost -range (low pri); config gaps list_margin semantics/markdown-default, diary_months, markdown_header_style, diary_caption_level=-1; and the path_html/template_path default-location divergences. Mappings audit came back clean. Tests: cmd.reject_list_item_range (test-keymaps.lua), cmd.VimwikiToggleRejectedListItem_accepts_range (test-keymaps-vim.vim). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -808,6 +808,22 @@ vim.defer_fn(function()
|
||||
error('range toggle incomplete: ' .. vim.inspect(vim.api.nvim_buf_get_lines(0, 0, -1, false)))
|
||||
end
|
||||
end)
|
||||
-- `:1,3VimwikiToggleRejectedListItem` — now -range (was bare → E481 on a
|
||||
-- ranged invocation, and cursor-only). Each line should gain a rejected
|
||||
-- checkbox `[-]`.
|
||||
tobj_case('cmd.reject_list_item_range', function()
|
||||
set_buf({ '- [ ] a', '- [ ] b', '- [ ] c' })
|
||||
vim.cmd('1,3VimwikiToggleRejectedListItem')
|
||||
local done = vim.wait(2000, function()
|
||||
for _, l in ipairs(vim.api.nvim_buf_get_lines(0, 0, -1, false)) do
|
||||
if not l:match('%[%-%]') then return false end
|
||||
end
|
||||
return true
|
||||
end, 30)
|
||||
if not done then
|
||||
error('range reject incomplete: ' .. vim.inspect(vim.api.nvim_buf_get_lines(0, 0, -1, false)))
|
||||
end
|
||||
end)
|
||||
-- `:VimwikiTable {cols} [rows]` — now -nargs=* (was -nargs=1, which dropped
|
||||
-- the args entirely). A 4-col table has 5 pipes per row; 3 data rows give
|
||||
-- header + separator + 3 = 5 table lines.
|
||||
|
||||
Reference in New Issue
Block a user