mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
perf(markdown): only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer
This commit is contained in:
parent
06d2749308
commit
8a6875ab3b
1 changed files with 8 additions and 0 deletions
|
@ -24,6 +24,14 @@ return {
|
|||
end
|
||||
end,
|
||||
},
|
||||
["markdownlint-cli2"] = {
|
||||
condition = function(_, ctx)
|
||||
local diag = vim.tbl_filter(function(d)
|
||||
return d.source == "markdownlint"
|
||||
end, vim.diagnostic.get(ctx.buf))
|
||||
return #diag > 0
|
||||
end,
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue