aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdnoC <adam.r.cutler@gmail.com>2021-01-02 23:37:27 -0500
committerThomas Vigouroux <tomvig38@gmail.com>2021-04-15 16:56:49 +0200
commitadd6eaf1810edd31340320bc75bccd93ab6faa9b (patch)
tree69e892bc24e5915eac33316d8dd6493b1979fbf4
parentledger: update highlights (diff)
downloadnvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar.gz
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar.bz2
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar.lz
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar.xz
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.tar.zst
nvim-treesitter-add6eaf1810edd31340320bc75bccd93ab6faa9b.zip
Do not use builtin tar on Windows
Several parsers (typescript and ocaml specifically) contain symlinks in their repo. The tar built into Windows cannot handle them. So, on Windows just use git to download parsers.
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index 013169fba..2aff84c67 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -123,8 +123,9 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
local is_github = repo.url:find("github.com", 1, true)
local is_gitlab = repo.url:find("gitlab.com", 1, true)
+ local is_windows = fn.hs('win32')
- if vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 and (is_github or is_gitlab) then
+ if vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 and (is_github or is_gitlab) and not is_windows then
revision = revision or repo.branch or "master"
local path_sep = utils.get_path_sep()