summaryrefslogtreecommitdiffstats
path: root/nvim/lua/kickstart
diff options
context:
space:
mode:
authorÉric NICOLAS <ccjmne@gmail.com>2024-10-30 16:41:46 +0100
committerGitHub <noreply@github.com>2024-10-30 11:41:46 -0400
commit74f8a1dc12908aa3041e53aae7b305827fb8a72f (patch)
tree71f0b39a26f2120f6e25e6e304da4de1f805ac2b /nvim/lua/kickstart
parentb106e010e6fc10ca33b7faf509ba239e5ef0112f (diff)
downloaddots-74f8a1dc12908aa3041e53aae7b305827fb8a72f.tar.gz
Disable linting autocmd for readonly buffers (#1202)
* 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> * Justify guarding try_lint in readonly buffers Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com> --------- Co-authored-by: Robin Gruyters <2082795+rgruyters@users.noreply.github.com>
Diffstat (limited to 'nvim/lua/kickstart')
-rw-r--r--nvim/lua/kickstart/plugins/lint.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/nvim/lua/kickstart/plugins/lint.lua b/nvim/lua/kickstart/plugins/lint.lua
index ca9bc23..907c6bf 100644
--- a/nvim/lua/kickstart/plugins/lint.lua
+++ b/nvim/lua/kickstart/plugins/lint.lua
@@ -47,7 +47,12 @@ return {
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
- lint.try_lint()
+ -- Only run the linter in buffers that you can modify in order to
+ -- avoid superfluous noise, notably within the handy LSP pop-ups that
+ -- describe the hovered symbol using Markdown.
+ if vim.opt_local.modifiable:get() then
+ lint.try_lint()
+ end
end,
})
end,