Patch by James Vega

Default to g:GPGPreferArmor = 1 for "*.asc" files if g:GPGPreferArmor is not set by the user.
This commit is contained in:
Markus Braun 2010-02-16 07:31:53 +00:00
parent f93f113717
commit 1e5a796e0b

View File

@ -71,7 +71,8 @@
" If set to 1 symmetric encryption is preferred for new files. Defaults to 0. " If set to 1 symmetric encryption is preferred for new files. Defaults to 0.
" "
" g:GPGPreferArmor " g:GPGPreferArmor
" If set to 1 armored data is preferred for new files. Defaults to 0. " If set to 1 armored data is preferred for new files. Defaults to 0
" unless a "*.asc" file is being edited.
" "
" g:GPGPreferSign " g:GPGPreferSign
" If set to 1 signed data is preferred for new files. Defaults to 0. " If set to 1 signed data is preferred for new files. Defaults to 0.
@ -82,7 +83,7 @@
" "
" Known Issues: {{{2 " Known Issues: {{{2
" "
" In some cases gvim can't decryt files " In some cases gvim can't decrypt files
" This is caused by the fact that a running gvim has no TTY and thus gpg is " This is caused by the fact that a running gvim has no TTY and thus gpg is
" not able to ask for the passphrase by itself. This is a problem for Windows " not able to ask for the passphrase by itself. This is a problem for Windows
@ -197,8 +198,13 @@ function s:GPGInit()
" check if armored files are preferred " check if armored files are preferred
if (!exists("g:GPGPreferArmor")) if (!exists("g:GPGPreferArmor"))
" .asc files should be armored as that's what the extension is used for
if expand('<afile>') =~ '\.asc$'
let g:GPGPreferArmor = 1
else
let g:GPGPreferArmor = 0 let g:GPGPreferArmor = 0
endif endif
endif
" check if signed files are preferred " check if signed files are preferred
if (!exists("g:GPGPreferSign")) if (!exists("g:GPGPreferSign"))