diff --git a/development/tests/test-keymaps.lua b/development/tests/test-keymaps.lua index ac82176..83cbe7a 100644 --- a/development/tests/test-keymaps.lua +++ b/development/tests/test-keymaps.lua @@ -834,6 +834,30 @@ vim.defer_fn(function() error('want 5 table lines (hdr+sep+3 rows), got ' .. #tbl) end end) + -- The Neovim :Vimwiki*Link Ex-commands used to dispatch to raw + -- vim.lsp.buf.definition(), bypassing the bare-word → [[link]] wrap that the + -- Vim branch and the mapping do. They now route through + -- follow_link_or_create; the wrap is a pure client-side buffer edit (no LSP), + -- so it's the headlessly-reliable observable. + tobj_case('cmd.VimwikiFollowLink_wraps_bare_word', function() + set_buf({ 'word here' }) + vim.api.nvim_win_set_cursor(0, { 1, 0 }) + vim.cmd('VimwikiFollowLink') + local got = vim.api.nvim_get_current_line() + if got ~= '[[word]] here' then + error('VimwikiFollowLink did not wrap bare word: ' .. got) + end + end) + tobj_case('cmd.VimwikiSplitLink_wraps_bare_word', function() + set_buf({ 'word here' }) + vim.api.nvim_win_set_cursor(0, { 1, 0 }) + vim.cmd('VimwikiSplitLink') + local got = vim.api.nvim_get_current_line() + vim.cmd('only') -- drop the split this command opened + if got ~= '[[word]] here' then + error('VimwikiSplitLink did not wrap bare word: ' .. got) + end + end) -- `:[range]VimwikiListChangeLvl {dir} [plus_children]` — now -range -nargs=+ -- (was -nargs=?, range-less). A 1,3 range with `increase` must indent the -- items that have somewhere to nest (the 2nd item under the 1st).