aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-11-26 12:56:59 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-11-28 00:19:09 +0100
commit754335b6492b1985f02fad37fade865e7751a719 (patch)
treee66763bbe97cb37299a5da7617c485959510dfd9
parentinjections(julia): add markdown (diff)
downloadnvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar.gz
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar.bz2
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar.lz
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar.xz
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.tar.zst
nvim-treesitter-754335b6492b1985f02fad37fade865e7751a719.zip
fix(install): don't auto-install ignored parsers
Fixes #3631
-rw-r--r--lua/nvim-treesitter/install.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index d7fdc4a51..fff3bb1c0 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -69,6 +69,10 @@ local function load_lockfile()
lockfile = vim.fn.filereadable(filename) == 1 and vim.fn.json_decode(vim.fn.readfile(filename)) or {}
end
+local function is_ignored_parser(lang)
+ return vim.tbl_contains(configs.get_ignored_parser_installs(), lang)
+end
+
local function get_revision(lang)
if #lockfile == 0 then
load_lockfile()
@@ -477,7 +481,7 @@ function M.setup_auto_install()
pattern = { "*" },
callback = function()
local lang = parsers.get_buf_lang()
- if parsers.get_parser_configs()[lang] and not is_installed(lang) then
+ if parsers.get_parser_configs()[lang] and not is_installed(lang) and not is_ignored_parser(lang) then
install() { lang }
end
end,