Skip to content

fix: Preprocess modules_dir to ensure successful module loading on Windows - #50

Open
WindyValley wants to merge 3 commits into
nvimdev:mainfrom
WindyValley:main
Open

fix: Preprocess modules_dir to ensure successful module loading on Windows#50
WindyValley wants to merge 3 commits into
nvimdev:mainfrom
WindyValley:main

Conversation

@WindyValley

Copy link
Copy Markdown

Probably for consistency with vim.fn.stdpath, core.helper.path_join uses '' as the path separator on Windows. However, even on Windows, the path returned by vim.fs.find still uses /. This caused pack:load_modules_packages to error when extracting the module name from the module path. To avoid compatibility issues with other places where core.helper.path_join is used, only preprocess modules_path with vim.fs.normalize in pack:load_modules_packages.

…Windows
Probably for consistency with `vim.fn.stdpath`, `core.helper.path_join` uses '\' as the path separator on Windows. However, even on Windows, the path returned by `vim.fs.find` still uses `/`. This caused `pack:load_modules_packages` to error when extracting the module name from the module path. To avoid compatibility issues with other places where `core.helper.path_join` is used, only preprocess modules_path with `vim.fs.normalize` in `pack:load_modules_packages`.
@WindyValley

WindyValley commented Sep 7, 2023

Copy link
Copy Markdown
Author

另外,有两个地方看符号名似乎用反了

functionhelper.data_path()
localcli=require('core.cli')
ifcli.config_paththen
returncli.config_path
end
returnvim.fn.stdpath('data')
end

functionhelper.config_path()
localcli=require('core.cli')
ifcli.data_paththen
returncli.data_path
end
returnvim.fn.stdpath('config')
end

我没用dope脚本,不太确定会有什么后果

Sign up for freeto 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.

1 participant

@WindyValley