From d1739cb7e1791e90d015610ef4aad30803babddb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 27 Dec 2022 12:35:02 +0100 Subject: [PATCH] feat(util): use treesitter to highlight notify messages when available --- lua/lazy/core/util.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 1c0facb..973d005 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -210,7 +210,9 @@ function M.notify(msg, level) vim.wo[win].concealcursor = "" vim.wo[win].spell = false local buf = vim.api.nvim_win_get_buf(win) - vim.bo[buf].filetype = "markdown" + if not pcall(vim.treesitter.start, buf, "markdown") then + vim.bo[buf].filetype = "markdown" + end end, title = "lazy.nvim", })