mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: alternative config disable format on save
This commit is contained in:
parent
aeeb5ccd1f
commit
4392eb6d59
3 changed files with 16 additions and 10 deletions
|
@ -50,12 +50,15 @@ if pcode.active_java_config.active then
|
|||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = function(_, opts)
|
||||
local psave = pcode.format_on_save or 0
|
||||
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
||||
opts.formatters_by_ft.java = { "google-java-format" }
|
||||
opts.format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
}
|
||||
if psave == 1 then
|
||||
opts.format_on_save = {
|
||||
timeout_ms = pcode.format_timeout_ms or 500,
|
||||
lsp_fallback = true,
|
||||
}
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
config = function(_, opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue