Set 'readonly' per the permissions of the encrypted file.
Closes jamessan/vim-gnupg#51 Signed-off-by: James McCoy <vega.james@gmail.com>
This commit is contained in:
parent
97436d1158
commit
a3e4dc94d4
@ -1,5 +1,5 @@
|
|||||||
" Name: gnupg.vim
|
" Name: gnupg.vim
|
||||||
" Last Change: 2015 Sep 29
|
" Last Change: 2015 Nov 04
|
||||||
" Maintainer: James McCoy <vega.james@gmail.com>
|
" Maintainer: James McCoy <vega.james@gmail.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.
|
||||||
@ -587,6 +587,7 @@ function s:GPGDecrypt(bufread)
|
|||||||
1mark [
|
1mark [
|
||||||
$mark ]
|
$mark ]
|
||||||
let &undolevels = levels
|
let &undolevels = levels
|
||||||
|
let &readonly = filereadable(filename) && filewritable(filename) == 0
|
||||||
" call the autocommand for the file minus .gpg$
|
" call the autocommand for the file minus .gpg$
|
||||||
silent execute ':doautocmd BufReadPost ' . autocmd_filename
|
silent execute ':doautocmd BufReadPost ' . autocmd_filename
|
||||||
call s:GPGDebug(2, 'called BufReadPost autocommand for ' . autocmd_filename)
|
call s:GPGDebug(2, 'called BufReadPost autocommand for ' . autocmd_filename)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user