From 044767a01d38208c32d97b0214cce66c41e8f7c8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 21 Dec 2022 15:49:22 +0100 Subject: [PATCH] fix: dont error in checkhealth if nvim-treesitter is not installed --- lua/noice/health.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/noice/health.lua b/lua/noice/health.lua index 5bf168b..c936af4 100644 --- a/lua/noice/health.lua +++ b/lua/noice/health.lua @@ -117,9 +117,9 @@ function M.check(opts) ) end - local _, ts = pcall(require, "nvim-treesitter.parsers") + local ok, ts = pcall(_G.require, "nvim-treesitter.parsers") - if ts then + if ok then log.ok("**treesitter-nvim** is installed") for _, ft in ipairs({ "vim", "regex", "lua", "bash", "markdown", "markdown_inline" }) do if ts.has_parser(ft) then