mirror of
https://github.com/neovim/neovim.git
synced 2025-10-20 00:31:49 +00:00
fix(help): wrong tag url in third-party help docs #36115
fix(help): only set url for nvim-owned tags Problem: 1. gx on |nonexistingtag| opens https://neovim.io/doc/user/helptag.html?nonexistingtag. 2. b:undo_ftplugin doesn't remove url extmarks. Solution: 1. Check if the tag is defined in a help file in $VIMRUNTIME. 2. Solution: clear namespace for buffer in b:undo_ftplugin.
This commit is contained in:

committed by
GitHub

parent
c6113da5a9
commit
62d3a2110d
@@ -202,6 +202,15 @@ describe('vim.ui', function()
|
||||
local tagname =
|
||||
n.api.nvim_buf_get_text(0, tag[2], tag[3], tag[4].end_row, tag[4].end_col, {})[1]
|
||||
eq(vim.uri_encode(tagname), param)
|
||||
|
||||
-- non-nvim tags are ignored
|
||||
local buf = n.api.nvim_create_buf(false, false)
|
||||
n.api.nvim_buf_set_lines(buf, 0, 0, false, {
|
||||
'|nonexisting|',
|
||||
})
|
||||
n.api.nvim_set_option_value('filetype', 'help', { buf = buf, scope = 'local' })
|
||||
local tags = n.api.nvim_buf_get_extmarks(buf, link_ns, 0, -1, {})
|
||||
eq(#tags, 0)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user