Refactor g:GPGRecipientsMenu to use list and rename to g:GPGPossibleRecipients

let g:GPGPossibleRecipients=[
    \"Example User <example@example.com>",
    \"Other User <otherexample@example.com>"
  \]
This commit is contained in:
Sebastian Neumann 2014-10-29 16:53:59 +01:00
parent 22f68e70cc
commit d316155866

View File

@ -95,14 +95,15 @@
" 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:GPGRecipientsMenu " g:GPGPossibleRecipients
" If set, these contents are loaded into the recipients dialog. This " If set, these contents are loaded into the recipients dialog. This
" allows to add commented lines with possible recipients to the list, " allows to add commented lines with possible recipients to the list,
" which can uncommented to select the actual recipients. Example: " which can be uncommented to select the actual recipients. Example:
" "
" let g:GPGRecipientsMenu="" " let g:GPGPossibleRecipients=[
" \."GPG: Example User <example@example.com>\<NL>" " \"Example User <example@example.com>",
" \."GPG: Other User <otherexample@example.com>\<NL>" " \"Other User <otherexample@example.com>"
" \]
" "
" "
" g:GPGUsePipes " g:GPGUsePipes
@ -284,8 +285,8 @@ function s:GPGInit(bufread)
let g:GPGDefaultRecipients = [] let g:GPGDefaultRecipients = []
endif endif
if (!exists("g:GPGRecipientsMenu")) if (!exists("g:GPGPossibleRecipients"))
let g:GPGRecipientsMenu = "" let g:GPGPossibleRecipients = []
endif endif
@ -819,9 +820,8 @@ function s:GPGEditRecipients()
let syntaxPattern = '\(' . join(flaggedNames, '\|') . '\)' let syntaxPattern = '\(' . join(flaggedNames, '\|') . '\)'
endif endif
let lines = split(g:GPGRecipientsMenu, "\n") for line in g:GPGPossibleRecipients
for line in lines silent put ='GPG: '.line
silent put =line
endfor endfor
" define highlight " define highlight