From febf2d4685936289c69372cf3a0ba144ef6b689a Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Mon, 28 Jan 2008 09:21:04 +0000 Subject: [PATCH] Changed recipient and option buffer handling This allows ':w' to close (besides ':q' and ':x') --- plugin/gnupg.vim | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index bcc94a6..7d076c6 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -504,7 +504,7 @@ fun s:GPGEditRecipients() exe 'silent! split ' . escape(editbuffername, ' *?\"'."'") " add a autocommand to regenerate the recipients after a write - autocmd BufHidden,BufUnload call s:GPGFinishRecipientsBuffer() + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishRecipientsBuffer() else if (bufwinnr(editbuffername) >= 0) " switch to scratch buffer window @@ -514,7 +514,7 @@ fun s:GPGEditRecipients() exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'") " add a autocommand to regenerate the recipients after a write - autocmd BufHidden,BufUnload call s:GPGFinishRecipientsBuffer() + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishRecipientsBuffer() endi " empty the buffer @@ -522,7 +522,8 @@ fun s:GPGEditRecipients() endi " Mark the buffer as a scratch buffer - setlocal buftype=nofile + setlocal buftype=acwrite + setlocal bufhidden=hide setlocal noswapfile setlocal nowrap setlocal nobuflisted @@ -655,6 +656,9 @@ fun s:GPGFinishRecipientsBuffer() echo 'There are no known recipients!' echohl None endi + + " reset modified flag + set nomodified endf " Function: s:GPGViewOptions() {{{2 @@ -710,7 +714,7 @@ fun s:GPGEditOptions() exe 'silent! split ' . escape(editbuffername, ' *?\"'."'") " add a autocommand to regenerate the options after a write - autocmd BufHidden,BufUnload call s:GPGFinishOptionsBuffer() + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishOptionsBuffer() else if (bufwinnr(editbuffername) >= 0) " switch to scratch buffer window @@ -720,7 +724,7 @@ fun s:GPGEditOptions() exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'") " add a autocommand to regenerate the options after a write - autocmd BufHidden,BufUnload call s:GPGFinishOptionsBuffer() + autocmd BufHidden,BufUnload,BufWriteCmd call s:GPGFinishOptionsBuffer() endi " empty the buffer @@ -825,6 +829,8 @@ fun s:GPGFinishOptionsBuffer() call setbufvar(b:corresponding_to, "GPGOptions", GPGOptions) call setbufvar(b:corresponding_to, "&mod", 1) + " reset modified flag + set nomodified endf " Function: s:GPGNameToID(name) {{{2