Do not set buftype=acwrite for FileReadCmd
FileReadCmd reads the contents of another file into the current buffer. Therefore, it should honor the settings ('buftype' and :file) of the current buffer. Closes jamessan/vim-gnupg#86 Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
parent
b54fd4c18a
commit
6be6f96aa5
@ -1,5 +1,5 @@
|
||||
" Name: gnupg.vim
|
||||
" Last Change: 2017 Dec 15
|
||||
" Last Change: 2018 Jan 23
|
||||
" Maintainer: James McCoy <jamessan@jamessan.com>
|
||||
" Original Author: Markus Braun <markus.braun@krawel.de>
|
||||
" Summary: Vim plugin for transparent editing of gpg encrypted files.
|
||||
@ -607,12 +607,14 @@ function s:GPGDecrypt(bufread)
|
||||
call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()")
|
||||
return
|
||||
endif
|
||||
if a:bufread
|
||||
" Ensure the buffer is only saved by using our BufWriteCmd
|
||||
set buftype=acwrite
|
||||
" Always set the buffer name to the absolute path, otherwise Vim won't
|
||||
" track the correct buffer name when changing directories (due to
|
||||
" buftype=acwrite).
|
||||
exe 'file' fnameescape(filename)
|
||||
endif
|
||||
else
|
||||
execute silent 'read' fnameescape(filename)
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user