diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index f6498eb..469b467 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,5 +1,5 @@ " Name: gnupg.vim -" Last Change: 2014 Dec 25 +" Last Change: 2015 Jan 01 " Maintainer: James McCoy " Original Author: Markus Braun " Summary: Vim plugin for transparent editing of gpg encrypted files. @@ -510,6 +510,14 @@ function s:GPGDecrypt(bufread) return endif + if a:bufread + silent execute ':doautocmd BufReadPre ' . fnameescape(expand(':r')) + call s:GPGDebug(2, 'called BufReadPre autocommand for ' . fnameescape(expand(':r'))) + else + silent execute ':doautocmd FileReadPre ' . fnameescape(expand(':r')) + call s:GPGDebug(2, 'called FileReadPre autocommand for ' . fnameescape(expand(':r'))) + endif + " check if the message is armored if (match(output, "gpg: armor header") >= 0) call s:GPGDebug(1, "this file is armored")