~havi/nvim.d

7a07607b39771459fab357da9d4a5440550111c3 — havi a month ago b33aabb
fix(after/ftplugin/rust): autoformat before save
1 files changed, 4 insertions(+), 2 deletions(-)

M after/ftplugin/rust.lua
M after/ftplugin/rust.lua => after/ftplugin/rust.lua +4 -2
@@ 185,6 185,8 @@ wk.register({
   noremap = true,
})
-- auto format before saving
vim.api.nvim_exec([[ autocmd BufWritePre *.rs :silent! lua vim.lsp.buf.format({async = true}) ]], false)
-- vim.api.nvim_exec([[ autocmd BufWritePre *.rs :silent! lua vim.lsp.buf.format({async = true}) ]], false)
vim.cmd('autocmd BufWritePre *.rs :silent! lua vim.lsp.buf.format({async = false})')
-- -- show/refresh diagnostics after saving
-- vim.api.nvim_exec([[ autocmd BufWritePost *.rs :silent! lua vim.diagnostic.setloclist() ]], false)
\ No newline at end of file
-- https://github.com/neovim/neovim/issues/13324#issuecomment-847353681
-- vim.cmd('autocmd BufWritePost *.rs lua vim.diagnostic.setloclist()')
\ No newline at end of file