test(client): cover bare gl/gL remove-checkbox + command-driven remove-done

Swap the gl<Space>/gL<Space> surface assertions for bare gl/gL; add behavioral
cases for gl (item) and gL (whole list) remove-checkbox, and drive remove-done
through :NuwikiRemoveDone / :NuwikiRemoveDone! now that it is command-only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 08:41:27 -03:00
parent a15ae184a0
commit cca2043294
2 changed files with 27 additions and 9 deletions
+26 -8
View File
@@ -211,7 +211,7 @@ vim.defer_fn(function()
{ '<C-Space>', 'nx' }, { '<C-@>', 'nx' }, { '<Nul>', 'nx' },
{ 'gnt', 'n' }, { 'gln', 'nx' }, { 'glp', 'nx' }, { 'glx', 'nx' },
{ 'glh', 'n' }, { 'gll', 'n' }, { 'gLh', 'n' }, { 'gLl', 'n' },
{ 'glr', 'n' }, { 'gLr', 'n' }, { 'gl<Space>', 'n' }, { 'gL<Space>', 'n' },
{ 'glr', 'n' }, { 'gLr', 'n' }, { 'gl', 'n' }, { 'gL', 'n' },
{ 'gl-', 'n' }, { 'gL-', 'n' }, { 'gl*', 'n' }, { 'gL*', 'n' },
{ 'gl#', 'n' }, { 'gL#', 'n' }, { 'gl1', 'n' }, { 'gL1', 'n' },
{ 'gli', 'n' }, { 'gLi', 'n' }, { 'glI', 'n' }, { 'gLI', 'n' },
@@ -340,33 +340,51 @@ vim.defer_fn(function()
expect_lines = { '1. one', '2. two', '3. three' },
})
-- ===== Remove done (gl<Space> current list / gL<Space> whole doc) =====
-- ===== Remove checkbox (bare gl item / gL whole list) =====
-- `gl<Space>` removes done items from the cursor's list only; the
-- Bare `gl` strips the checkbox from the cursor's item, keeping the text.
run('list.remove_checkbox_item_via_gl', {
lines = { '= test =', '- [ ] task', '- [X] done' },
cursor = { 2, 0 },
keys = 'gl',
expect_line = '- task',
expect_at = 2,
})
-- Bare `gL` strips the checkbox from every item in the cursor's list.
run('list.remove_checkbox_list_via_gL', {
lines = { '- [ ] a', '- [X] b', '- [ ] c' },
cursor = { 1, 0 },
keys = 'gL',
expect_lines = { '- a', '- b', '- c' },
})
-- ===== Remove done (command-only: :NuwikiRemoveDone[!]) =====
-- `:NuwikiRemoveDone` removes done items from the cursor's list only; the
-- second list's done item survives.
run('list.remove_done_current_list_via_gl_space', {
run('list.remove_done_current_list_via_command', {
lines = {
'- [X] done a', '- [ ] todo a', '',
'paragraph', '',
'- [ ] todo b', '- [X] done b',
},
cursor = { 1, 0 },
keys = 'gl<Space>',
keys = ':NuwikiRemoveDone<CR>',
expect_lines = {
'- [ ] todo a', '',
'paragraph', '',
'- [ ] todo b', '- [X] done b',
},
})
-- `gL<Space>` sweeps the whole buffer regardless of cursor position.
run('list.remove_done_whole_buffer_via_gL_space', {
-- `:NuwikiRemoveDone!` sweeps the whole buffer regardless of cursor position.
run('list.remove_done_whole_buffer_via_command_bang', {
lines = {
'- [X] done a', '- [ ] todo a', '',
'paragraph', '',
'- [ ] todo b', '- [X] done b',
},
cursor = { 1, 0 },
keys = 'gL<Space>',
keys = ':NuwikiRemoveDone!<CR>',
expect_lines = {
'- [ ] todo a', '',
'paragraph', '',