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>
This commit is contained in:
Éric NICOLAS (ccjmne) 2024-10-20 22:34:07 +02:00
parent 4120893b8a
commit 01ab2a4543
No known key found for this signature in database
GPG Key ID: 9B49C8C163B3320C
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ return {
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup, group = lint_augroup,
callback = function() callback = function()
lint.try_lint() if vim.opt_local.modifiable:get() then
lint.try_lint()
end
end, end,
}) })
end, end,