Skip to content

Commit

Permalink
After writing the buffer to disk, update 'readonly'
Browse files Browse the repository at this point in the history
Signed-off-by: James McCoy <vega.james@gmail.com>
  • Loading branch information
jamessan committed Nov 5, 2015
1 parent 1c61d3f commit ccdf455
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/gnupg.vim
Expand Up @@ -726,9 +726,11 @@ function s:GPGEncrypt()
return
endif

call rename(destfile, resolve(expand('<afile>')))
let filename = resolve(expand('<afile>'))
call rename(destfile, filename)
if auType == 'BufWrite'
setl nomodified
let &readonly = filereadable(filename) && filewritable(filename) == 0
endif

silent exe ':doautocmd '. auType .'Post '. autocmd_filename
Expand Down

0 comments on commit ccdf455

Please sign in to comment.