mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +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
|
return
|
||||||
end
|
end
|
||||||
local ft = vim.bo[buf].filetype
|
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", {
|
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
|
||||||
bufnr = buf,
|
bufnr = buf,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue