-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(bootstrap): improve stdpath override #3893
base: master
Are you sure you want to change the base?
Conversation
end | ||
return vim.call("stdpath", what) | ||
end | ||
|
||
vim.api.nvim_call_function = function(fn, args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this function commonly used? or is it for covering all the basis? I'm not sure it's worth it if it's the latter, since there are quite a few ways that can still access these values.
-- elseif what == "data" then | ||
-- return _G.get_runtime_dir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- elseif what == "data" then | |
-- return _G.get_runtime_dir() |
@@ -64,15 +64,25 @@ function M:init(base_dir) | |||
self.lazy_install_dir = join_paths(self.pack_dir, "lazy", "opt", "lazy.nvim") | |||
|
|||
---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function internally | |||
---NOTE: changes to "data" are currently unstable, see #2507 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep this note 🥲
---@diagnostic disable-next-line: duplicate-set-field | ||
vim.fn.stdpath = function(what) | ||
if what == "cache" then | ||
return _G.get_cache_dir() | ||
elseif what == "config" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the corresponding test, see https://github.com/LunarVim/LunarVim/pull/2540/files#diff-e02939ff80b05af32ad541b952d46570ab42ca3386e9eeab4bd4990955af4687
Following #3855
As we are not going to deprecate not using $NVIM_APPNAME, this is still relevant.
I removed the
data
override so that it's not breaking. But at least things likeNullLsLog
will show correctly.