mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(format): dont format if client capaibilities disabled it. #249
This commit is contained in:
parent
e8766c5edd
commit
fab6150da9
1 changed files with 5 additions and 0 deletions
|
@ -38,6 +38,11 @@ function M.format()
|
|||
end
|
||||
|
||||
function M.on_attach(client, buf)
|
||||
-- dont format if client disabled it
|
||||
if client.config.capabilities.documentFormattingProvider == false then
|
||||
return
|
||||
end
|
||||
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = vim.api.nvim_create_augroup("LspFormat." .. buf, {}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue