call nvim_command(wa) using pcall() to prevent unnamed buffer error from preventing session from saving
parent
a8a0bfd2f1
commit
ad183f1a8c
|
|
@ -136,7 +136,7 @@ function M.save(opts)
|
|||
if type(config.save_pre) == "function" then
|
||||
config.save_pre()
|
||||
end
|
||||
vim.api.nvim_command("wa")
|
||||
pcall(vim.api.nvim_command, "wa")
|
||||
vim.api.nvim_command("mksession! " .. e(opts.session or vim.g.persisting_session or M.current()))
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue