GPGCleanup: Use "only!" to force hiding modified buffers

In dda14abb3c, GPGCleanup added 'set
buffhidden=hide' to try avoiding error messages when modified buffers
are being abandoned.  However, that only works if the buffer is the last
visible buffer.

If there are windows displaying multiple buffers, then errors can still
be emitted.  Using "only!" ensures all the other windows can be closed.

Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
James McCoy
2016-12-17 20:51:26 -05:00
parent dda14abb3c
commit 45fdaf52ed

View File

@@ -1,5 +1,5 @@
" Name: gnupg.vim " Name: gnupg.vim
" Last Change: 2016 Dec 14 " Last Change: 2016 Dec 17
" Maintainer: James McCoy <jamessan@jamessan.com> " Maintainer: James McCoy <jamessan@jamessan.com>
" Original Author: Markus Braun <markus.braun@krawel.de> " Original Author: Markus Braun <markus.braun@krawel.de>
" Summary: Vim plugin for transparent editing of gpg encrypted files. " Summary: Vim plugin for transparent editing of gpg encrypted files.
@@ -420,11 +420,8 @@ endfunction
function s:GPGCleanup() function s:GPGCleanup()
call s:GPGDebug(3, ">>>>>>>> Entering s:GPGCleanup()") call s:GPGDebug(3, ">>>>>>>> Entering s:GPGCleanup()")
" Ensure we can hide the buffer
setlocal bufhidden=hide
" wipe out screen " wipe out screen
new +only new +only!
redraw! redraw!
call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGCleanup()") call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGCleanup()")