Skip to content

Commit

Permalink
perf(util): don't try to load nvim-treesitter when markdown parser is…
Browse files Browse the repository at this point in the history
… builtin
  • Loading branch information
folke committed Oct 3, 2023
1 parent 59335c5 commit 8b73492
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/lazy/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b73492

Please sign in to comment.