fix(news): use $VIMRUNTIME for news.txt path

Use `vim.env.VIMRUNTIME` to resolve `news.txt` instead of
`nvim_get_runtime_file()`, which can return a plugin's
`news.txt` (e.g., rainbow-delimiters.nvim) instead of
Neovim's bundled one.
This commit is contained in:
Samyak Bardiya 2026-02-21 19:30:25 +05:30
parent c64a61734f
commit 4ff5e8bf81
No known key found for this signature in database
GPG key ID: 9EC480389A2D4976

View file

@ -51,7 +51,7 @@ function M.open(file, opts)
end end
file = plugin.dir .. "/" .. file file = plugin.dir .. "/" .. file
elseif opts.rtp then elseif opts.rtp then
file = vim.api.nvim_get_runtime_file(file, false)[1] file = vim.fs.joinpath(vim.env.VIMRUNTIME, "doc", "news.txt")
end end
if not file then if not file then