File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -675,7 +675,7 @@ require('lazy').setup({
675675 {
676676 ' <leader>f' ,
677677 function ()
678- require (' conform' ).format { async = true , lsp_fallback = true }
678+ require (' conform' ).format { async = true , lsp_format = ' fallback ' }
679679 end ,
680680 mode = ' ' ,
681681 desc = ' [F]ormat buffer' ,
@@ -688,9 +688,15 @@ require('lazy').setup({
688688 -- have a well standardized coding style. You can add additional
689689 -- languages here or re-enable it for the disabled ones.
690690 local disable_filetypes = { c = true , cpp = true }
691+ local lsp_format_opt
692+ if disable_filetypes [vim .bo [bufnr ].filetype ] then
693+ lsp_format_opt = ' never'
694+ else
695+ lsp_format_opt = ' fallback'
696+ end
691697 return {
692698 timeout_ms = 500 ,
693- lsp_fallback = not disable_filetypes [ vim . bo [ bufnr ]. filetype ] ,
699+ lsp_format = lsp_format_opt ,
694700 }
695701 end ,
696702 formatters_by_ft = {
You can’t perform that action at this time.
0 commit comments