From ccdf455426cd7538de0139ae9d583d2a38ac0e89 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 4 Nov 2015 22:03:35 -0500 Subject: [PATCH] After writing the buffer to disk, update 'readonly' Signed-off-by: James McCoy --- plugin/gnupg.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 47eced1..0f7f3f7 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -726,9 +726,11 @@ function s:GPGEncrypt() return endif - call rename(destfile, resolve(expand(''))) + let filename = resolve(expand('')) + call rename(destfile, filename) if auType == 'BufWrite' setl nomodified + let &readonly = filereadable(filename) && filewritable(filename) == 0 endif silent exe ':doautocmd '. auType .'Post '. autocmd_filename