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

fix: prioritize user config for extensions on windows #1215

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

daephx
Copy link
Contributor

@daephx daephx commented Mar 21, 2024

Fixes the second part of: #1213

The same logic fixed in (#1214) is duplicated in the lualine_require module, which appears to be used internally for loading things like extensions.

On windows, user defined extensions that overwrite the builtins similarly cannot be loaded due to the same string matching issue. In addition, the number of queried runtime files is always less-than or equal to 1 due to the all parameter for nvim_get_runtime_file being set to false. Making it impossible to sort the list of files and prioritize ones within the users config path vim.fn.stdpath("config").

Fixes the second part of: nvim-lualine#1213

The same logic fixed in (nvim-lualine#1214) is duplicated in the lualine_require
module, which appears to be used internally for loading things like
extensions.

On windows, user defined extensions that overwrite the builtin similarly
cannot be loaded due to the same string matching issue. In addition, the
number of queried runtime files is always less-than or equal to 1 due to
the `all` parameter for `nvim_get_runtime_file` being set to false.
Making it impossible to sort the list of files and prioritize ones
within the users config path `vim.fn.stdpath("config")`.
@daephx
Copy link
Contributor Author

daephx commented Aug 9, 2024

Hi @shadmansaleh,

I wanted to follow up on this PR which has been open for a few months. I understand you might be busy, but I’d appreciate it if you could take a look when you have the chance. Thanks!

Upon reflection, the change from vim.startswith to string.match was a bit superfluous, as the main issue is just that the path string needed a trailing separator to prevent bad matches with Windows $ENV:LOCALAPPDATA\nvim-data. But both results are basically the same.

@shadmansaleh shadmansaleh merged commit b431d22 into nvim-lualine:master Aug 12, 2024
5 checks passed
@shadmansaleh
Copy link
Member

Thanks again. I didn't see this one.

@daephx daephx deleted the fix-user-extensions branch August 12, 2024 21:44
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.

2 participants