After writing the buffer to disk, update 'readonly'

Signed-off-by: James McCoy <vega.james@gmail.com>
This commit is contained in:
James McCoy 2015-11-04 22:03:35 -05:00
parent 1c61d3f9ed
commit ccdf455426
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -726,9 +726,11 @@ function s:GPGEncrypt()
return return
endif endif
call rename(destfile, resolve(expand('<afile>'))) let filename = resolve(expand('<afile>'))
call rename(destfile, filename)
if auType == 'BufWrite' if auType == 'BufWrite'
setl nomodified setl nomodified
let &readonly = filereadable(filename) && filewritable(filename) == 0
endif endif
silent exe ':doautocmd '. auType .'Post '. autocmd_filename silent exe ':doautocmd '. auType .'Post '. autocmd_filename