mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(format): only do null-ls formatting logic when null-ls is availble. Fixes #684
This commit is contained in:
parent
86ac9989ea
commit
eb143ebe11
1 changed files with 2 additions and 1 deletions
|
@ -25,7 +25,8 @@ function M.format(opts)
|
|||
return
|
||||
end
|
||||
local ft = vim.bo[buf].filetype
|
||||
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
|
||||
local have_nls = package.loaded["null-ls"]
|
||||
and (#require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0)
|
||||
|
||||
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
|
||||
bufnr = buf,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue