Tue, 14 Mar 2023 22:56:37 -0500
try to fix stopinsert/autowrite again
.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 @@ -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)