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 @@ -702,7 +702,7 @@ require('lazy').setup({
702702 {
703703 ' <leader>f' ,
704704 function ()
705- require (' conform' ).format { async = true , lsp_fallback = true }
705+ require (' conform' ).format { async = true , lsp_format = ' fallback ' }
706706 end ,
707707 mode = ' ' ,
708708 desc = ' [F]ormat buffer' ,
@@ -715,9 +715,15 @@ require('lazy').setup({
715715 -- have a well standardized coding style. You can add additional
716716 -- languages here or re-enable it for the disabled ones.
717717 local disable_filetypes = { c = true , cpp = true }
718+ local lsp_format_opt
719+ if disable_filetypes [vim .bo [bufnr ].filetype ] then
720+ lsp_format_opt = ' never'
721+ else
722+ lsp_format_opt = ' fallback'
723+ end
718724 return {
719725 timeout_ms = 500 ,
720- lsp_fallback = not disable_filetypes [ vim . bo [ bufnr ]. filetype ] ,
726+ lsp_format = lsp_format_opt ,
721727 }
722728 end ,
723729 formatters_by_ft = {
You can’t perform that action at this time.
0 commit comments