feat(util): use treesitter to highlight notify messages when available

This commit is contained in:
Folke Lemaitre 2022-12-27 12:35:02 +01:00
parent e183601763
commit d1739cb7e1
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 1 deletions

View File

@ -210,7 +210,9 @@ function M.notify(msg, level)
vim.wo[win].concealcursor = "" vim.wo[win].concealcursor = ""
vim.wo[win].spell = false vim.wo[win].spell = false
local buf = vim.api.nvim_win_get_buf(win) local buf = vim.api.nvim_win_get_buf(win)
if not pcall(vim.treesitter.start, buf, "markdown") then
vim.bo[buf].filetype = "markdown" vim.bo[buf].filetype = "markdown"
end
end, end,
title = "lazy.nvim", title = "lazy.nvim",
}) })