|
@@ -62,7 +62,7 @@ local toggle_autoformat = function()
|
|
require("core.autocmds").define_augroups {
|
|
require("core.autocmds").define_augroups {
|
|
autoformat = {
|
|
autoformat = {
|
|
{
|
|
{
|
|
- "BufWritePost",
|
|
|
|
|
|
+ "BufWritePre",
|
|
"*",
|
|
"*",
|
|
":silent lua vim.lsp.buf.formatting_sync()",
|
|
":silent lua vim.lsp.buf.formatting_sync()",
|
|
},
|
|
},
|
|
@@ -71,7 +71,7 @@ local toggle_autoformat = function()
|
|
end
|
|
end
|
|
|
|
|
|
if not lvim.format_on_save then
|
|
if not lvim.format_on_save then
|
|
- vim.cmd [[if exists('#autoformat#BufWritePost')
|
|
|
|
|
|
+ vim.cmd [[if exists('#autoformat#BufWritePre')
|
|
:autocmd! autoformat
|
|
:autocmd! autoformat
|
|
endif]]
|
|
endif]]
|
|
end
|
|
end
|