From d0540c6b4839d43cf711210a8e9f2b8b213516e0 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Thu, 16 Nov 2006 16:12:57 +0000 Subject: [PATCH] Information about missing environment GPG_TTY. --- plugin/gnupg.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 06ad5ff..f844b5d 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -43,7 +43,7 @@ " Prints the list of options. " " Variables: -" GPGUseAgent +" g:GPGUseAgent " If set to 1 a possible available gpg-agent is used. Defaults to 0. " " Credits: @@ -97,12 +97,18 @@ highlight default GPGHighlightUnknownRecipient term=reverse ctermfg=Red cterm=un " fun s:GPGInit() " check if gpg-agent is allowed - if (!exists("GPGUseAgent")) - let GPGUseAgent = 0 + if (!exists("g:GPGUseAgent")) + let g:GPGUseAgent = 0 endif " determine if gnupg can use the gpg-agent - if (exists("$GPG_AGENT_INFO") && GPGUseAgent == 1) + if (exists("$GPG_AGENT_INFO") && g:GPGUseAgent == 1) + if (!exists("$GPG_TTY")) + echohl GPGError + echo "The GPG_TTY is not set!" + echo "gpg-agent might not work." + echohl None + endif let s:GPGCommand="LANG=C gpg --use-agent" else let s:GPGCommand="LANG=C gpg --no-use-agent"