Skip to content

Commit 48d0f75

Browse files
iton0mynever
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 519f197 commit 48d0f75

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
@@ -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 = {

0 commit comments

Comments
 (0)