perf(util): don't try to load nvim-treesitter when markdown parser is builtin

This commit is contained in:
Folke Lemaitre 2023-10-04 00:19:29 +02:00
parent 59335c5b9d
commit 8b73492249
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 6 additions and 1 deletions

View File

@ -315,7 +315,12 @@ function M.notify(msg, opts)
local lang = opts.lang or "markdown" local lang = opts.lang or "markdown"
vim.notify(msg, opts.level or vim.log.levels.INFO, { vim.notify(msg, opts.level or vim.log.levels.INFO, {
on_open = function(win) 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].conceallevel = 3
vim.wo[win].concealcursor = "" vim.wo[win].concealcursor = ""
vim.wo[win].spell = false vim.wo[win].spell = false