mirror of
https://github.com/Ascyii/vim-gnupg.git
synced 2026-01-01 06:14:24 -05:00
Changed recipient and option buffer handling
This allows ':w' to close (besides ':q' and ':x')
This commit is contained in:
@@ -504,7 +504,7 @@ fun s:GPGEditRecipients()
|
|||||||
exe 'silent! split ' . escape(editbuffername, ' *?\"'."'")
|
exe 'silent! split ' . escape(editbuffername, ' *?\"'."'")
|
||||||
|
|
||||||
" add a autocommand to regenerate the recipients after a write
|
" add a autocommand to regenerate the recipients after a write
|
||||||
autocmd BufHidden,BufUnload <buffer> call s:GPGFinishRecipientsBuffer()
|
autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishRecipientsBuffer()
|
||||||
else
|
else
|
||||||
if (bufwinnr(editbuffername) >= 0)
|
if (bufwinnr(editbuffername) >= 0)
|
||||||
" switch to scratch buffer window
|
" switch to scratch buffer window
|
||||||
@@ -514,7 +514,7 @@ fun s:GPGEditRecipients()
|
|||||||
exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'")
|
exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'")
|
||||||
|
|
||||||
" add a autocommand to regenerate the recipients after a write
|
" add a autocommand to regenerate the recipients after a write
|
||||||
autocmd BufHidden,BufUnload <buffer> call s:GPGFinishRecipientsBuffer()
|
autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishRecipientsBuffer()
|
||||||
endi
|
endi
|
||||||
|
|
||||||
" empty the buffer
|
" empty the buffer
|
||||||
@@ -522,7 +522,8 @@ fun s:GPGEditRecipients()
|
|||||||
endi
|
endi
|
||||||
|
|
||||||
" Mark the buffer as a scratch buffer
|
" Mark the buffer as a scratch buffer
|
||||||
setlocal buftype=nofile
|
setlocal buftype=acwrite
|
||||||
|
setlocal bufhidden=hide
|
||||||
setlocal noswapfile
|
setlocal noswapfile
|
||||||
setlocal nowrap
|
setlocal nowrap
|
||||||
setlocal nobuflisted
|
setlocal nobuflisted
|
||||||
@@ -655,6 +656,9 @@ fun s:GPGFinishRecipientsBuffer()
|
|||||||
echo 'There are no known recipients!'
|
echo 'There are no known recipients!'
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
" reset modified flag
|
||||||
|
set nomodified
|
||||||
endf
|
endf
|
||||||
|
|
||||||
" Function: s:GPGViewOptions() {{{2
|
" Function: s:GPGViewOptions() {{{2
|
||||||
@@ -710,7 +714,7 @@ fun s:GPGEditOptions()
|
|||||||
exe 'silent! split ' . escape(editbuffername, ' *?\"'."'")
|
exe 'silent! split ' . escape(editbuffername, ' *?\"'."'")
|
||||||
|
|
||||||
" add a autocommand to regenerate the options after a write
|
" add a autocommand to regenerate the options after a write
|
||||||
autocmd BufHidden,BufUnload <buffer> call s:GPGFinishOptionsBuffer()
|
autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishOptionsBuffer()
|
||||||
else
|
else
|
||||||
if (bufwinnr(editbuffername) >= 0)
|
if (bufwinnr(editbuffername) >= 0)
|
||||||
" switch to scratch buffer window
|
" switch to scratch buffer window
|
||||||
@@ -720,7 +724,7 @@ fun s:GPGEditOptions()
|
|||||||
exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'")
|
exe 'silent! sbuffer ' . escape(editbuffername, ' *?\"'."'")
|
||||||
|
|
||||||
" add a autocommand to regenerate the options after a write
|
" add a autocommand to regenerate the options after a write
|
||||||
autocmd BufHidden,BufUnload <buffer> call s:GPGFinishOptionsBuffer()
|
autocmd BufHidden,BufUnload,BufWriteCmd <buffer> call s:GPGFinishOptionsBuffer()
|
||||||
endi
|
endi
|
||||||
|
|
||||||
" empty the buffer
|
" empty the buffer
|
||||||
@@ -825,6 +829,8 @@ fun s:GPGFinishOptionsBuffer()
|
|||||||
call setbufvar(b:corresponding_to, "GPGOptions", GPGOptions)
|
call setbufvar(b:corresponding_to, "GPGOptions", GPGOptions)
|
||||||
call setbufvar(b:corresponding_to, "&mod", 1)
|
call setbufvar(b:corresponding_to, "&mod", 1)
|
||||||
|
|
||||||
|
" reset modified flag
|
||||||
|
set nomodified
|
||||||
endf
|
endf
|
||||||
|
|
||||||
" Function: s:GPGNameToID(name) {{{2
|
" Function: s:GPGNameToID(name) {{{2
|
||||||
|
|||||||
Reference in New Issue
Block a user