aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-03-01 17:18:51 +0100
committerStephan Seitz <stephan.lauf@yahoo.de>2021-03-02 16:55:18 +0100
commit1df50b3435e4753c56a58c80fd9486c2213138a8 (patch)
treef73c8dcdbc5640b8fc91e72ac575d614432cf743 /lua
parenthighlights(c): update declaration and cast_expression (diff)
downloadnvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar.gz
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar.bz2
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar.lz
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar.xz
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.tar.zst
nvim-treesitter-1df50b3435e4753c56a58c80fd9486c2213138a8.zip
Fix #972: Add tar-download support for Gitlab
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/parsers.lua2
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua10
2 files changed, 9 insertions, 3 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index 8ce9552f5..506020b66 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -317,7 +317,7 @@ list.vue = {
list.jsonc = {
install_info = {
- url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git",
+ url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc",
files = { "src/parser.c" },
},
readme_name = "JSON with comments",
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index 532632284..bd5e9097b 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -109,10 +109,15 @@ function M.select_mv_cmd(from, to, cwd)
end
function M.select_download_commands(repo, project_name, cache_folder, revision)
- if vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 and repo.url:find("github.com", 1, true) then
+
+ local is_github = repo.url:find("github.com", 1, true)
+ local is_gitlab = repo.url:find("gitlab.com", 1, true)
+
+ if vim.fn.executable('tar') == 1 and vim.fn.executable('curl') == 1 and (is_github or is_gitlab) then
revision = revision or repo.branch or "master"
local path_sep = utils.get_path_sep()
+
return {
M.select_install_rm_cmd(cache_folder, project_name..'-tmp'),
{
@@ -122,7 +127,8 @@ function M.select_download_commands(repo, project_name, cache_folder, revision)
opts = {
args = {
'-L', -- follow redirects
- repo.url.."/archive/"..revision..".tar.gz",
+ is_github and repo.url.."/archive/"..revision..".tar.gz"
+ or repo.url.."/-/archive/"..revision.."/"..project_name.."-"..revision..".tar.gz",
'--output',
project_name..".tar.gz"
},