diff options
author | Abouzar Parvan <[email protected]> | 2021-08-19 18:30:44 +0430 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-19 16:00:44 +0200 |
commit | 1f45d1531d3636102f8971f8b2103b5302f48b68 (patch) | |
tree | d3b5911ffaeb3be7e661399039c78830812e14fd /lua | |
parent | 0bf6fd68c625396d83eb8fca8d7248c5543ae6f1 (diff) |
[Bugfix] fix formatter/linter nil issue (#1353)
* fix formatter/linter issue for undefined lang/filetypes
* revrese the order
Diffstat (limited to 'lua')
-rw-r--r-- | lua/default-config.lua | 2 | ||||
-rw-r--r-- | lua/lsp/null-ls/formatters.lua | 2 | ||||
-rw-r--r-- | lua/lsp/null-ls/linters.lua | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lua/default-config.lua b/lua/default-config.lua index 09a25fd3..7e8ebea6 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -1189,7 +1189,7 @@ lvim.lang = { }, vim = { formatters = {}, - linters = { "" }, + linters = {}, lsp = { provider = "vimls", setup = { diff --git a/lua/lsp/null-ls/formatters.lua b/lua/lsp/null-ls/formatters.lua index d6ede29d..cae1fa7d 100644 --- a/lua/lsp/null-ls/formatters.lua +++ b/lua/lsp/null-ls/formatters.lua @@ -63,7 +63,7 @@ function M.list_configured(formatter_configs) end function M.setup(filetype, options) - if formatters_by_ft[filetype] and not options.force_reload then + if not lvim.lang[filetype] or (formatters_by_ft[filetype] and not options.force_reload) then return end diff --git a/lua/lsp/null-ls/linters.lua b/lua/lsp/null-ls/linters.lua index 64d2db4a..b449a4f2 100644 --- a/lua/lsp/null-ls/linters.lua +++ b/lua/lsp/null-ls/linters.lua @@ -63,7 +63,7 @@ function M.list_configured(linter_configs) end function M.setup(filetype, options) - if linters_by_ft[filetype] and not options.force_reload then + if not lvim.lang[filetype] or (linters_by_ft[filetype] and not options.force_reload) then return end |