Skip to content

Commit 02bac39

Browse files
iton0diegorodriguezv
authored andcommitted
fix: remove deprecated opt for conform.nvim (nvim-lua#1070)
- changed lsp_fallback -> lsp_format - updated format_on_save function to reflect change above
1 parent ca1be84 commit 02bac39

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

init.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ require('lazy').setup({
689689
{
690690
'<leader>f',
691691
function()
692-
require('conform').format { async = true, lsp_fallback = true }
692+
require('conform').format { async = true, lsp_format = 'fallback' }
693693
end,
694694
mode = '',
695695
desc = '[F]ormat buffer',
@@ -702,9 +702,15 @@ require('lazy').setup({
702702
-- have a well standardized coding style. You can add additional
703703
-- languages here or re-enable it for the disabled ones.
704704
local disable_filetypes = { c = true, cpp = true }
705+
local lsp_format_opt
706+
if disable_filetypes[vim.bo[bufnr].filetype] then
707+
lsp_format_opt = 'never'
708+
else
709+
lsp_format_opt = 'fallback'
710+
end
705711
return {
706712
timeout_ms = 500,
707-
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
713+
lsp_format = lsp_format_opt,
708714
}
709715
end,
710716
formatters_by_ft = {

0 commit comments

Comments
 (0)