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({
675
675
{
676
676
' <leader>f' ,
677
677
function ()
678
- require (' conform' ).format { async = true , lsp_fallback = true }
678
+ require (' conform' ).format { async = true , lsp_format = ' fallback ' }
679
679
end ,
680
680
mode = ' ' ,
681
681
desc = ' [F]ormat buffer' ,
@@ -688,9 +688,15 @@ require('lazy').setup({
688
688
-- have a well standardized coding style. You can add additional
689
689
-- languages here or re-enable it for the disabled ones.
690
690
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
691
697
return {
692
698
timeout_ms = 500 ,
693
- lsp_fallback = not disable_filetypes [ vim . bo [ bufnr ]. filetype ] ,
699
+ lsp_format = lsp_format_opt ,
694
700
}
695
701
end ,
696
702
formatters_by_ft = {
You can’t perform that action at this time.
0 commit comments