Use “:read ++edit !...” so file encoding/format detection triggers

Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
James McCoy 2016-09-17 22:39:17 -04:00
parent 28e0be4cd2
commit 22cca0c821
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -1,5 +1,5 @@
" Name: gnupg.vim " Name: gnupg.vim
" Last Change: 2016 Aug 25 " Last Change: 2016 Sep 17
" Maintainer: James McCoy <jamessan@jamessan.com> " Maintainer: James McCoy <jamessan@jamessan.com>
" Original Author: Markus Braun <markus.braun@krawel.de> " Original Author: Markus Braun <markus.braun@krawel.de>
" Summary: Vim plugin for transparent editing of gpg encrypted files. " Summary: Vim plugin for transparent editing of gpg encrypted files.
@ -175,7 +175,7 @@
if (exists("g:loaded_gnupg") || &cp || exists("#GnuPG")) if (exists("g:loaded_gnupg") || &cp || exists("#GnuPG"))
finish finish
endif endif
let g:loaded_gnupg = '2.6' let g:loaded_gnupg = '2.6.1-dev'
let s:GPGInitRun = 0 let s:GPGInitRun = 0
" check for correct vim version {{{2 " check for correct vim version {{{2
@ -568,7 +568,7 @@ function s:GPGDecrypt(bufread)
" since even with the --quiet option passphrase typos will be reported, " since even with the --quiet option passphrase typos will be reported,
" we must redirect stderr (using shell temporarily) " we must redirect stderr (using shell temporarily)
call s:GPGDebug(1, "decrypting file") call s:GPGDebug(1, "decrypting file")
let cmd = { 'level': 1, 'ex': silent . 'r !' } let cmd = { 'level': 1, 'ex': silent . 'read ++edit !' }
let cmd.args = '--quiet --decrypt ' . s:shellescape(filename, 1) let cmd.args = '--quiet --decrypt ' . s:shellescape(filename, 1)
call s:GPGExecute(cmd) call s:GPGExecute(cmd)
@ -714,7 +714,7 @@ function s:GPGEncrypt()
" encrypt the buffer " encrypt the buffer
let destfile = tempname() let destfile = tempname()
let cmd = { 'level': 1, 'ex': "'[,']w !" } let cmd = { 'level': 1, 'ex': "'[,']write !" }
let cmd.args = '--quiet --no-encrypt-to ' . options let cmd.args = '--quiet --no-encrypt-to ' . options
let cmd.redirect = '>' . s:shellescape(destfile, 1) let cmd.redirect = '>' . s:shellescape(destfile, 1)
silent call s:GPGExecute(cmd) silent call s:GPGExecute(cmd)