test: add the Neovim *Link wrap cases referenced by 2b3bc48
The previous commit's test-insert Edit silently no-matched (wrong anchor text), so cmd.VimwikiFollowLink_wraps_bare_word and cmd.VimwikiSplitLink_wraps_bare_word were referenced in the commit message and gap doc but never added. Add them now at the correct anchor; the lua harness goes 278 → 280, both new cases pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 <CR> 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).
|
||||
|
||||
Reference in New Issue
Block a user