Skip to content

Commit

Permalink
fix(conform-nvim): update to using new default_format_opts configur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
mehalter committed Jul 19, 2024
1 parent 4e33ed3 commit 876032f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/astrocommunity/editing-support/conform-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ return {
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format { async = true, lsp_format = "fallback", range = range }
require("conform").format { async = true, range = range }
end,
desc = "Format buffer",
range = true,
Expand Down Expand Up @@ -62,11 +62,12 @@ return {
},
},
opts = {
default_format_opts = { lsp = "fallback" },
format_on_save = function(bufnr)
if vim.g.autoformat == nil then vim.g.autoformat = true end
local autoformat = vim.b[bufnr].autoformat
if autoformat == nil then autoformat = vim.g.autoformat end
if autoformat then return { timeout_ms = 500, lsp_format = "fallback" } end
if autoformat then return { timeout_ms = 500 } end
end,
},
}

0 comments on commit 876032f

Please sign in to comment.