mirror of
https://github.com/Ascyii/vim-gnupg.git
synced 2026-01-01 14:24:25 -05:00
Use echom instead of plain echo
This way warnings and errors are stored in message list.
This commit is contained in:
@@ -143,8 +143,8 @@ fun s:GPGInit()
|
|||||||
if (v:shell_error)
|
if (v:shell_error)
|
||||||
let $GPG_TTY = ""
|
let $GPG_TTY = ""
|
||||||
echohl GPGError
|
echohl GPGError
|
||||||
echo "The GPG_TTY is not set and no TTY could be found using the `tty` command!"
|
echom "The GPG_TTY is not set and no TTY could be found using the `tty` command!"
|
||||||
echo "gpg-agent might not work."
|
echom "gpg-agent might not work."
|
||||||
echohl None
|
echohl None
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -229,7 +229,7 @@ fun s:GPGDecrypt()
|
|||||||
call s:GPGDebug(1, "cipher-algo is " . cipher)
|
call s:GPGDebug(1, "cipher-algo is " . cipher)
|
||||||
else
|
else
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "The cipher " . cipher . " is not known by the local gpg command. Using default!"
|
echom "The cipher " . cipher . " is not known by the local gpg command. Using default!"
|
||||||
echo
|
echo
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
@@ -252,7 +252,7 @@ fun s:GPGDecrypt()
|
|||||||
else
|
else
|
||||||
let b:GPGUnknownRecipients=b:GPGUnknownRecipients . recipient . ":"
|
let b:GPGUnknownRecipients=b:GPGUnknownRecipients . recipient . ":"
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "The recipient " . recipient . " is not in your public keyring!"
|
echom "The recipient " . recipient . " is not in your public keyring!"
|
||||||
echohl None
|
echohl None
|
||||||
end
|
end
|
||||||
let start=match(output, "gpg: public key is [[:xdigit:]]\\{8}", start)
|
let start=match(output, "gpg: public key is [[:xdigit:]]\\{8}", start)
|
||||||
@@ -262,7 +262,7 @@ fun s:GPGDecrypt()
|
|||||||
let b:GPGEncrypted=0
|
let b:GPGEncrypted=0
|
||||||
call s:GPGDebug(1, "this file is not encrypted")
|
call s:GPGDebug(1, "this file is not encrypted")
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
set nobin
|
set nobin
|
||||||
return
|
return
|
||||||
@@ -330,7 +330,7 @@ fun s:GPGEncrypt()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -374,7 +374,7 @@ fun s:GPGEncrypt()
|
|||||||
if (strlen(gpgid) <= 0)
|
if (strlen(gpgid) <= 0)
|
||||||
let GPGUnknownRecipients=GPGUnknownRecipients . cur_recipient . ":"
|
let GPGUnknownRecipients=GPGUnknownRecipients . cur_recipient . ":"
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "The recipient " . cur_recipient . " is not in your public keyring!"
|
echom "The recipient " . cur_recipient . " is not in your public keyring!"
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
endi
|
endi
|
||||||
@@ -383,8 +383,8 @@ fun s:GPGEncrypt()
|
|||||||
" check if there are unknown recipients and warn
|
" check if there are unknown recipients and warn
|
||||||
if(strlen(GPGUnknownRecipients) > 0)
|
if(strlen(GPGUnknownRecipients) > 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "There are unknown recipients!!"
|
echom "There are unknown recipients!!"
|
||||||
echo "Please use GPGEditRecipients to correct!!"
|
echom "Please use GPGEditRecipients to correct!!"
|
||||||
echo
|
echo
|
||||||
echohl None
|
echohl None
|
||||||
call s:GPGDebug(1, "unknown recipients are: " . GPGUnknownRecipients)
|
call s:GPGDebug(1, "unknown recipients are: " . GPGUnknownRecipients)
|
||||||
@@ -399,7 +399,7 @@ fun s:GPGEncrypt()
|
|||||||
let match_result=match(known_recipients, cur_unknown_recipient.":")
|
let match_result=match(known_recipients, cur_unknown_recipient.":")
|
||||||
if(match_result > 0 && strlen(cur_unknown_recipient) > 0)
|
if(match_result > 0 && strlen(cur_unknown_recipient) > 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "Removing ". cur_unknown_recipient ." from recipientlist!\n"
|
echom "Removing ". cur_unknown_recipient ." from recipientlist!\n"
|
||||||
echohl None
|
echohl None
|
||||||
let Known_Recipients=substitute(known_recipients, cur_unknown_recipient .":", "", "g")
|
let Known_Recipients=substitute(known_recipients, cur_unknown_recipient .":", "", "g")
|
||||||
endi
|
endi
|
||||||
@@ -424,8 +424,8 @@ fun s:GPGEncrypt()
|
|||||||
else
|
else
|
||||||
if (match(b:GPGOptions, "encrypt:") >= 0)
|
if (match(b:GPGOptions, "encrypt:") >= 0)
|
||||||
echohl GPGError
|
echohl GPGError
|
||||||
echo "There are no recipients!!"
|
echom "There are no recipients!!"
|
||||||
echo "Please use GPGEditRecipients to correct!!"
|
echom "Please use GPGEditRecipients to correct!!"
|
||||||
echo
|
echo
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
@@ -489,7 +489,7 @@ fun s:GPGViewRecipients()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -523,7 +523,7 @@ fun s:GPGViewRecipients()
|
|||||||
" check if there is any known recipient
|
" check if there is any known recipient
|
||||||
if (strlen(s:GetField(b:GPGRecipients, ":", 0)) == 0)
|
if (strlen(s:GetField(b:GPGRecipients, ":", 0)) == 0)
|
||||||
echohl GPGError
|
echohl GPGError
|
||||||
echo 'There are no known recipients!'
|
echom 'There are no known recipients!'
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
endi
|
endi
|
||||||
@@ -537,7 +537,7 @@ fun s:GPGEditRecipients()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -648,7 +648,7 @@ fun s:GPGFinishRecipientsBuffer()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -685,7 +685,7 @@ fun s:GPGFinishRecipientsBuffer()
|
|||||||
else
|
else
|
||||||
let GPGUnknownRecipients=GPGUnknownRecipients . recipient . ":"
|
let GPGUnknownRecipients=GPGUnknownRecipients . recipient . ":"
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "The recipient " . recipient . " is not in your public keyring!"
|
echom "The recipient " . recipient . " is not in your public keyring!"
|
||||||
echohl None
|
echohl None
|
||||||
end
|
end
|
||||||
endi
|
endi
|
||||||
@@ -704,7 +704,7 @@ fun s:GPGFinishRecipientsBuffer()
|
|||||||
" check if there is any known recipient
|
" check if there is any known recipient
|
||||||
if (strlen(s:GetField(GPGRecipients, ":", 0)) == 0)
|
if (strlen(s:GetField(GPGRecipients, ":", 0)) == 0)
|
||||||
echohl GPGError
|
echohl GPGError
|
||||||
echo 'There are no known recipients!'
|
echom 'There are no known recipients!'
|
||||||
echohl None
|
echohl None
|
||||||
endi
|
endi
|
||||||
|
|
||||||
@@ -720,7 +720,7 @@ fun s:GPGViewOptions()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -747,7 +747,7 @@ fun s:GPGEditOptions()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
@@ -837,7 +837,7 @@ fun s:GPGFinishOptionsBuffer()
|
|||||||
" guard for unencrypted files
|
" guard for unencrypted files
|
||||||
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
if (exists("b:GPGEncrypted") && b:GPGEncrypted == 0)
|
||||||
echohl GPGWarning
|
echohl GPGWarning
|
||||||
echo "File is not encrypted, all GPG functions disabled!"
|
echom "File is not encrypted, all GPG functions disabled!"
|
||||||
echohl None
|
echohl None
|
||||||
return
|
return
|
||||||
endi
|
endi
|
||||||
|
|||||||
Reference in New Issue
Block a user