Reduce "$GPG_TTY unset" message to one line and highlight as a warning.

It's possible that gpg will work fine without $GPG_TTY being set (e.g., when
using a GUI pinentry program).  Therefore, the message should be classified as
a warning, not an error.

Also, use a single :echom to ensure the user sees the entire message, not just
"gpg-agent might not work."

First part of GH #1

Signed-off-by: James McCoy <vega.james@gmail.com>
This commit is contained in:
James McCoy 2012-10-28 16:44:07 -04:00
parent 5c600287c7
commit 4a649a2dce

View File

@ -1,5 +1,5 @@
" Name: gnupg.vim
" Last Change: 2012 May 31
" Last Change: 2012 Oct 28
" Maintainer: James McCoy <vega.james@gmail.com>
" Original Author: Markus Braun <markus.braun@krawel.de>
" Summary: Vim plugin for transparent editing of gpg encrypted files.
@ -267,9 +267,8 @@ function s:GPGInit(bufread)
let $GPG_TTY = system("tty")
if (v:shell_error)
let $GPG_TTY = ""
echohl GPGError
echom "The GPG_TTY is not set and no TTY could be found using the `tty` command!"
echom "gpg-agent might not work."
echohl GPGWarning
echom "$GPG_TTY is not set and the `tty` command failed! gpg-agent might not work."
echohl None
endif
endif