mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 20:41:08 +00:00
fix(news): resolve news.txt from $VIMRUNTIME first
Plugins that ship their own `doc/news.txt` (e.g. rainbow-delimiters.nvim) can shadow Neovim's bundled file when using `nvim_get_runtime_file()`. First check $VIMRUNTIME, then fall back to the full runtimepath. Fixes #7019
This commit is contained in:
parent
c64a61734f
commit
60fea6236e
1 changed files with 3 additions and 1 deletions
|
|
@ -51,7 +51,9 @@ 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]
|
-- first check if file exists in VIMRUNTIME, then check the full runtimepath
|
||||||
|
local path = vim.env.VIMRUNTIME .. "/" .. file --[[@as string]]
|
||||||
|
file = vim.uv.fs_stat(path) and path or vim.api.nvim_get_runtime_file(file, false)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
if not file then
|
if not file then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue