From 8b73492249100d8a9ce9d874f7ea5a71b4d6f07e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 4 Oct 2023 00:19:29 +0200 Subject: [PATCH] perf(util): don't try to load nvim-treesitter when markdown parser is builtin --- lua/lazy/core/util.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 3e0042e..d1d6bec 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -315,7 +315,12 @@ function M.notify(msg, opts) local lang = opts.lang or "markdown" vim.notify(msg, opts.level or vim.log.levels.INFO, { on_open = function(win) - pcall(require, "nvim-treesitter") + local ok = pcall(function() + vim.treesitter.language.add("markdown") + end) + if not ok then + pcall(require, "nvim-treesitter") + end vim.wo[win].conceallevel = 3 vim.wo[win].concealcursor = "" vim.wo[win].spell = false