Merge pull request #21 from tyll/menu

Add g:GPGRecipientsMenu
This commit is contained in:
James McCoy
2014-11-20 23:52:31 -05:00

View File

@@ -95,6 +95,17 @@
" If set, these recipients are used as defaults when no other recipient is " If set, these recipients are used as defaults when no other recipient is
" defined. This variable is a Vim list. Default is unset. " defined. This variable is a Vim list. Default is unset.
" "
" g:GPGPossibleRecipients
" If set, these contents are loaded into the recipients dialog. This
" allows to add commented lines with possible recipients to the list,
" which can be uncommented to select the actual recipients. Example:
"
" let g:GPGPossibleRecipients=[
" \"Example User <example@example.com>",
" \"Other User <otherexample@example.com>"
" \]
"
"
" g:GPGUsePipes " g:GPGUsePipes
" If set to 1, use pipes instead of temporary files when interacting with " If set to 1, use pipes instead of temporary files when interacting with
" gnupg. When set to 1, this can cause terminal-based gpg agents to not " gnupg. When set to 1, this can cause terminal-based gpg agents to not
@@ -274,6 +285,11 @@ function s:GPGInit(bufread)
let g:GPGDefaultRecipients = [] let g:GPGDefaultRecipients = []
endif endif
if (!exists("g:GPGPossibleRecipients"))
let g:GPGPossibleRecipients = []
endif
" prefer not to use pipes since it can garble gpg agent display " prefer not to use pipes since it can garble gpg agent display
if (!exists("g:GPGUsePipes")) if (!exists("g:GPGUsePipes"))
let g:GPGUsePipes = 0 let g:GPGUsePipes = 0
@@ -804,6 +820,10 @@ function s:GPGEditRecipients()
let syntaxPattern = '\(' . join(flaggedNames, '\|') . '\)' let syntaxPattern = '\(' . join(flaggedNames, '\|') . '\)'
endif endif
for line in g:GPGPossibleRecipients
silent put ='GPG: '.line
endfor
" define highlight " define highlight
if (has("syntax") && exists("g:syntax_on")) if (has("syntax") && exists("g:syntax_on"))
highlight clear GPGUnknownRecipient highlight clear GPGUnknownRecipient