Merge pull request #30182 from neovim/backport-30180-to-release-0.10

fix(man): check if buffer is valid before restoring 'tagfunc'
This commit is contained in:
zeertzjq
2024-08-29 20:21:47 +08:00
committed by GitHub

View File

@@ -714,7 +714,7 @@ function M.open_page(count, smods, args)
end
sect, name = extract_sect_and_name_path(path)
local buf = fn.bufnr()
local buf = api.nvim_get_current_buf()
local save_tfu = vim.bo[buf].tagfunc
vim.bo[buf].tagfunc = "v:lua.require'man'.goto_tag"
@@ -730,7 +730,9 @@ function M.open_page(count, smods, args)
end
end)
vim.bo[buf].tagfunc = save_tfu
if api.nvim_buf_is_valid(buf) then
vim.bo[buf].tagfunc = save_tfu
end
if not ok then
error(ret)