Skip to content

Commit 8d92db7

Browse files
iton0Alessandro201
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 d9ae2e5 commit 8d92db7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

init.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ require('lazy').setup({
806806
{
807807
'<leader>f',
808808
function()
809-
require('conform').format { async = true, lsp_fallback = true }
809+
require('conform').format { async = true, lsp_format = 'fallback' }
810810
end,
811811
mode = { 'n', 'v' },
812812
desc = '[F]ormat file or range (in visual mode)',
@@ -819,12 +819,17 @@ require('lazy').setup({
819819
-- -- have a well standardized coding style. You can add additional
820820
-- -- languages here or re-enable it for the disabled ones.
821821
-- local disable_filetypes = { c = true, cpp = true }
822+
-- local lsp_format_opt
823+
-- if disable_filetypes[vim.bo[bufnr].filetype] then
824+
-- lsp_format_opt = 'never'
825+
-- else
826+
-- lsp_format_opt = 'fallback'
827+
-- end
822828
-- return {
823-
-- timeout_ms = 1000,
824-
-- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
829+
-- timeout_ms = 500,
830+
-- lsp_format = lsp_format_opt,
825831
-- }
826832
-- end,
827-
format_on_save = false,
828833
formatters_by_ft = {
829834
-- You can use 'stop_after_first' to run the first available formatter from the list
830835
-- javascript = { "prettierd", "prettier", stop_after_first = true },

0 commit comments

Comments
 (0)