aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorGithub Actions <actions@github>2020-12-10 16:32:20 +0000
committerKiyan <yazdani.kiyan@protonmail.com>2020-12-12 19:04:43 +0100
commitd8f75f0b093632159d825fdf84e0ea6dbf05cd75 (patch)
tree3073ff1f50dc8a4cfc54b7f23f880bcfaf611214 /lua
parentAdd fix for vim.fn.executable(vim.NIL) (diff)
downloadnvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar.gz
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar.bz2
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar.lz
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar.xz
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.tar.zst
nvim-treesitter-d8f75f0b093632159d825fdf84e0ea6dbf05cd75.zip
[docgen] Update README.md
skip-checks: true
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/install.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index b1d1fc1fb..a34177e21 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -323,8 +323,11 @@ function M.uninstall(lang)
end
end
-function M.write_lockfile(verbose)
+function M.write_lockfile(verbose, skip_langs)
local sorted_parsers = {}
+ -- Load previous lockfile
+ get_revision()
+ skip_langs = skip_langs or {}
for k, v in pairs(parsers.get_parser_configs()) do
table.insert(sorted_parsers, {name = k, parser = v})
@@ -333,11 +336,16 @@ function M.write_lockfile(verbose)
table.sort(sorted_parsers, function(a, b) return a.name < b.name end)
for _, v in ipairs(sorted_parsers) do
- -- I'm sure this can be done in aync way with iter_cmd
- local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1]
- lockfile[v.name] = { revision = sha }
- if verbose then
- print(v.name..': '..sha)
+
+ if not vim.tbl_contains(skip_langs, v.name) then
+ -- I'm sure this can be done in aync way with iter_cmd
+ local sha = vim.split(vim.fn.systemlist('git ls-remote '..v.parser.install_info.url)[1], '\t')[1]
+ lockfile[v.name] = { revision = sha }
+ if verbose then
+ print(v.name..': '..sha)
+ end
+ else
+ print('Skipping '..v.name)
end
end