diff options
| author | kiyan42 <yazdani.kiyan@protonmail.com> | 2020-06-30 08:51:52 +0200 |
|---|---|---|
| committer | Kiyan Yazdani <yazdani.kiyan@protonmail.com> | 2020-06-30 08:54:32 +0200 |
| commit | c70a8242eb346e77f2b554c7fa207a767583ffb4 (patch) | |
| tree | 06c0efb875d853045d56e8a2fe9fe1f553095a48 | |
| parent | Define multiple query for a language (diff) | |
| download | nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar.gz nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar.bz2 nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar.lz nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar.xz nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.tar.zst nvim-treesitter-c70a8242eb346e77f2b554c7fa207a767583ffb4.zip | |
fix ask install
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 7be01b6ee..f2972005c 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -144,7 +144,7 @@ local function install_lang(lang, ask_reinstall, cache_folder, package_path, wit end -- TODO(kyazdani): this should work on windows too -local function install(with_sync) +local function install(with_sync, ask_reinstall) return function (...) if fn.has('win32') == 1 then return api.nvim_err_writeln('This command is not available on windows at the moment.') @@ -161,33 +161,33 @@ local function install(with_sync) if err then return api.nvim_err_writeln(err) end local languages - local ask_reinstall + local ask if ... == 'all' then languages = parsers.available_parsers() - ask_reinstall = false + ask = false else languages = vim.tbl_flatten({...}) - ask_reinstall = true + ask = ask_reinstall end for _, lang in ipairs(languages) do - install_lang(lang, ask_reinstall, cache_folder, package_path, with_sync) + install_lang(lang, ask, cache_folder, package_path, with_sync) end end end -M.ensure_installed = install(false) +M.ensure_installed = install(false, false) M.commands = { TSInstall = { - run = install(false), + run = install(false, true), args = { "-nargs=+", "-complete=custom,v:lua.ts_installable_parsers" } }, TSInstallSync = { - run = install(true), + run = install(true, true), args = { "-nargs=+", "-complete=custom,v:lua.ts_installable_parsers" |
