diff --git a/autoload/gnupg.vim b/autoload/gnupg.vim index afae8cd..5d43bdf 100644 --- a/autoload/gnupg.vim +++ b/autoload/gnupg.vim @@ -680,8 +680,11 @@ function gnupg#edit_recipients() endif if s:NewInputBuffer('GPGRecipients') - " add a autocommand to regenerate the recipients after a write - autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishRecipientsBuffer() + augroup GPGRecipients + au! * + " add a autocommand to regenerate the recipients after a write + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishRecipientsBuffer() + augroup END " put some comments to the scratch buffer silent put ='GPG: ----------------------------------------------------------------------' @@ -767,9 +770,6 @@ function s:GPGFinishRecipientsBuffer() execute 'silent! ' . bufwinnr(expand(":p")) . "wincmd w" endif - " delete the autocommand - autocmd! * - " get the recipients from the scratch buffer let recipients = [] let lines = getline(1,"$") @@ -856,8 +856,11 @@ function gnupg#edit_options() " only do this if it isn't already a GPGOptions_* buffer if s:NewInputBuffer('GPGOptions') - " add a autocommand to regenerate the options after a write - autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishOptionsBuffer() + augroup GPGOptions + au! * + " add a autocommand to regenerate the options after a write + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishOptionsBuffer() + augroup END " put some comments to the scratch buffer silent put ='GPG: ----------------------------------------------------------------------' @@ -916,9 +919,6 @@ function s:GPGFinishOptionsBuffer() let options = [] let unknownOptions = [] - " delete the autocommand - autocmd! * - " get the options from the scratch buffer let lines = getline(1, "$") for option in lines