Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

opalmay
Copy link
Contributor

@opalmay opalmay commented Feb 24, 2023

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 like NullLsLog will show correctly.

@opalmay opalmay changed the title refactor(bootstrap): better overrides refactor(bootstrap): improve stdpath override Feb 24, 2023
end
return vim.call("stdpath", what)
end

vim.api.nvim_call_function = function(fn, args)
Copy link
Collaborator

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.

Comment on lines +73 to +74
-- elseif what == "data" then
-- return _G.get_runtime_dir()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- 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
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants