Only disable swapfile, undofile, and viminfo when editing a file.

Signed-off-by: James McCoy <vega.james@gmail.com>
This commit is contained in:
James McCoy 2012-05-30 22:17:05 -04:00
parent bceace5df6
commit 256810ab64

View File

@ -189,6 +189,11 @@ highlight default link GPGHighlightUnknownRecipient ErrorMsg
function s:GPGInit(bufread) function s:GPGInit(bufread)
call s:GPGDebug(3, printf(">>>>>>>> Entering s:GPGInit(%d)", a:bufread)) call s:GPGDebug(3, printf(">>>>>>>> Entering s:GPGInit(%d)", a:bufread))
" For FileReadCmd, we're reading the contents into another buffer. If that
" buffer is also destined to be encrypted, then these settings will have
" already been set, otherwise don't set them since it limits the
" functionality of the cleartext buffer.
if a:bufread
" we don't want a swap file, as it writes unencrypted data to disk " we don't want a swap file, as it writes unencrypted data to disk
setl noswapfile setl noswapfile
@ -197,15 +202,16 @@ function s:GPGInit(bufread)
setl noundofile setl noundofile
endif endif
" first make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
set viminfo=
endif
" the rest only has to be run once " the rest only has to be run once
if s:GPGInitRun if s:GPGInitRun
return return
endif endif
" first make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
set viminfo=
" check what gpg command to use " check what gpg command to use
if (!exists("g:GPGExecutable")) if (!exists("g:GPGExecutable"))
let g:GPGExecutable = "gpg --trust-model always" let g:GPGExecutable = "gpg --trust-model always"