diff --git a/lua/tailwind-tools/conceal.lua b/lua/tailwind-tools/conceal.lua index ad69a5a..8af118b 100644 --- a/lua/tailwind-tools/conceal.lua +++ b/lua/tailwind-tools/conceal.lua @@ -36,11 +36,13 @@ end M.enable = function() vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, { group = vim.g.tailwind_tools.conceal_au, + pattern = config.options.supported_filetypes, callback = function(args) set_conceal(args.buf) end, }) -- Workaround to reset conceallevel per buffer vim.api.nvim_create_autocmd("BufEnter", { group = vim.g.tailwind_tools.conceal_au, + pattern = config.options.supported_filetypes, callback = function(args) vim.wo.conceallevel = vim.opt.conceallevel:get() if state.conceal.enabled then set_conceal(args.buf) end @@ -60,6 +62,7 @@ end M.disable = function() vim.wo.conceallevel = 0 vim.api.nvim_clear_autocmds({ + pattern = config.options.supported_filetypes, group = vim.g.tailwind_tools.conceal_au, event = { "TextChanged", "TextChangedI" }, }) diff --git a/lua/tailwind-tools/init.lua b/lua/tailwind-tools/init.lua index 0bafeac..ed0403f 100644 --- a/lua/tailwind-tools/init.lua +++ b/lua/tailwind-tools/init.lua @@ -43,6 +43,7 @@ M.setup = function(options) vim.api.nvim_create_autocmd("LspAttach", { group = vim.g.tailwind_tools.conceal_au, + pattern = config.options.supported_filetypes, callback = lsp.on_attach, })