The workaround is only needed to get the containing terminal and Vim
back in sync. When running in a gvim, this clearly is not needed.
Closesjamessan/vim-gnupg#126
Signed-off-by: James McCoy <jamessan@jamessan.com>
When bufwinnr() returns -1, the buffer isn't currently displayed. In
this case, we need to return so the contents of a different buffer
aren't used for recipients/options.
The BufHidden autocommand will have already called the respective Finish
function. Clearing the autocommands during BufUnload ensures they don't
inadvertently run when Vim is shutting down.
Closesjamessan/vim-gnupg#104
This allows for easier on-the-fly debug (e.g., ":verbose w") and also
makes it easy to leverage 'verbosefile'.
Signed-off-by: James McCoy <jamessan@jamessan.com>
Instead of assuming a single line is output, which may be wrong in error
conditions, use the '[/'] marks to delete everything that was read.
Closesjamessan/vim-gnupg#106
Signed-off-by: James McCoy <jamessan@jamessan.com>
This allows them to be properly cleared only when the buffer is
re-created/loaded. This fixes the handling of the autocmds when the
Edit buffer is saved, but not hidden or deleted.
The autocmd remains in place, rather than having an acwrite buffer with
no autocmd set.
Signed-off-by: James McCoy <jamessan@jamessan.com>