diff --git a/development/tests/test-keymaps-vim.vim b/development/tests/test-keymaps-vim.vim index 0062396..6df7d65 100644 --- a/development/tests/test-keymaps-vim.vim +++ b/development/tests/test-keymaps-vim.vim @@ -188,7 +188,7 @@ let s:mapping_surface = [ \ ['', 'nx'], ['', 'nx'], ['', 'nx'], \ ['gnt', 'n'], ['gln', 'nx'], ['glp', 'nx'], ['glx', 'nx'], \ ['glh', 'n'], ['gll', 'n'], ['gLh', 'n'], ['gLl', 'n'], - \ ['glr', 'n'], ['gLr', 'n'], ['gl', 'n'], ['gL', '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'], diff --git a/development/tests/test-keymaps.lua b/development/tests/test-keymaps.lua index f7b28b1..e5a8162 100644 --- a/development/tests/test-keymaps.lua +++ b/development/tests/test-keymaps.lua @@ -211,7 +211,7 @@ vim.defer_fn(function() { '', 'nx' }, { '', 'nx' }, { '', 'nx' }, { 'gnt', 'n' }, { 'gln', 'nx' }, { 'glp', 'nx' }, { 'glx', 'nx' }, { 'glh', 'n' }, { 'gll', 'n' }, { 'gLh', 'n' }, { 'gLl', 'n' }, - { 'glr', 'n' }, { 'gLr', 'n' }, { 'gl', 'n' }, { 'gL', '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 current list / gL whole doc) ===== + -- ===== Remove checkbox (bare gl item / gL whole list) ===== - -- `gl` 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', + keys = ':NuwikiRemoveDone', expect_lines = { '- [ ] todo a', '', 'paragraph', '', '- [ ] todo b', '- [X] done b', }, }) - -- `gL` 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', + keys = ':NuwikiRemoveDone!', expect_lines = { '- [ ] todo a', '', 'paragraph', '',