From 5103285d4d59cc9d2d56e6e897b8efbbb460b774 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 14 Feb 2017 22:08:42 -0500 Subject: [PATCH] Set "buftype=acwrite" for encrypted buffers This ensures any write of the buffer requires a configured BufWriteCmd autocmd, providing more safe guards against problems like jamessan/vim-gnupg#77. Signed-off-by: James McCoy --- plugin/gnupg.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index ddc310a..5be49c2 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -583,6 +583,8 @@ function s:GPGDecrypt(bufread) call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()") return endif + " Ensure the buffer is only saved by using our BufWriteCmd + set buftype=acwrite else execute silent 'read' fnameescape(filename) endif