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 <jamessan@jamessan.com>
This commit is contained in:
parent
7d0a149169
commit
5103285d4d
@ -583,6 +583,8 @@ function s:GPGDecrypt(bufread)
|
|||||||
call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()")
|
call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
" Ensure the buffer is only saved by using our BufWriteCmd
|
||||||
|
set buftype=acwrite
|
||||||
else
|
else
|
||||||
execute silent 'read' fnameescape(filename)
|
execute silent 'read' fnameescape(filename)
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user