diff options
| author | TheLeoP <eugenio2305@hotmail.com> | 2023-06-15 07:40:39 -0500 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | dd6ec132684fccb32de3713ad94b8aa4f8795fe6 (patch) | |
| tree | 0dc4f97113357ff0f3a224f77ab75180707ff39d | |
| parent | fix: check if config has install_info in filter (diff) | |
| download | nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar.gz nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar.bz2 nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar.lz nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar.xz nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.tar.zst nvim-treesitter-dd6ec132684fccb32de3713ad94b8aa4f8795fe6.zip | |
fix: always normalize paths
Not doing this results in paths with a mix of '\\' and '/' for Windows.
This isn't a problem when dealing with Neovim/luv APIs, but it is a
problem when comparing strings.
| -rw-r--r-- | lua/nvim-treesitter/health.lua | 2 | ||||
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 099e766da..1d6400977 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -110,7 +110,7 @@ local function install_health() end if vim.iter(vim.api.nvim_list_runtime_paths()):any(function(p) - if installdir == p .. '/' then + if installdir == vim.fs.normalize(p) .. '/' then return true end end) diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index af95fdeed..ff5cff036 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -562,7 +562,7 @@ local function install(languages, options, _callback) return end - local cache_dir = vim.fn.stdpath('cache') + local cache_dir = vim.fs.normalize(vim.fn.stdpath('cache')) local install_dir = config.get_install_dir('parser') if not languages or type(languages) == 'string' then |
