fix error when unnamed buffers can't be written

Tue, 19 Sep 2023 17:12:00 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Tue, 19 Sep 2023 17:12:00 -0500
changeset 1129
1bd6edeaf6ae
parent 1128
30d81fbc6a7b
child 1130
91a00bcc28f9

fix error when unnamed buffers can't be written

.config/nvim/lua/config/autocmds.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/config/autocmds.lua
+++ b/.config/nvim/lua/config/autocmds.lua
@@ -17,7 +17,7 @@ autocmd(g, { "WinLeave", "FocusLost" }, 
   if fn.pumvisible() == 0 then
     cmd.stopinsert()
   end
-  cmd.wa()
+  pcall(cmd.wa)
 end)
 
 -- >> auto mkpath on write

mercurial