--- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -14,14 +14,12 @@ autocmd(g, "FocusGained", "*", cmd.check -- >> autowriteall improvment -- Stopinsert on leave, or autowriteall doesn't work. autocmd(g, { "WinLeave", "FocusLost" }, "*", function() - if not fn.pumvisible() then + if fn.pumvisible() == 0 then fn.stopinsert() end + cmd.wa() end) --- write all on leave -autocmd(g, "FocusLost", "*", cmd.wa) - -- >> auto mkpath on write autocmd(g, "BufWritePre", "*", { callback = function(ctx)