From 01ab2a45439126927ec18ec244afd5e8a2eb38a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20NICOLAS=20=28ccjmne=29?= Date: Sun, 20 Oct 2024 22:34:07 +0200 Subject: [PATCH] Disable linting autocmd for readonly buffers This should avoid linting in buffers outside of the user's control, having in mind especially the handy LSP pop-ups that describe your hovered symbol using markdown. Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --- lua/kickstart/plugins/lint.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index ca9bc237..4fc6282f 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -47,7 +47,9 @@ return { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() - lint.try_lint() + if vim.opt_local.modifiable:get() then + lint.try_lint() + end end, }) end,