perf(markdown): only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer
This commit is contained in:
@ -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" },
|
||||
|
Reference in New Issue
Block a user