nvim: Check linter existence before setting options
We only change 'markdownlint' arguments if it actually exists in the nvim-lint 'linters' table.
This commit is contained in:
parent
cf9a25d1c6
commit
5913948705
1 changed files with 3 additions and 1 deletions
|
|
@ -19,7 +19,9 @@ return {
|
|||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
require("lint").linters_by_ft = linters
|
||||
if require("lint").linters["markdownlint"] ~= nil then
|
||||
require("lint").linters.markdownlint.args = { "--stdin", "--disable", "MD013", "--" }
|
||||
end
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, {
|
||||
callback = function()
|
||||
if not vim.g.disable_autolint then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue