GPGEdit{Recipients,Options}: Check for presence of b:GPGCorrespondingTo
Since the user can control which file patterns are handled by the plugin (via g:GPGFilePattern), the regular expression checking the buffer name for GPGEdit{Recipients,Options} may not match. A simpler and more definitive check is to see whether b:GPGCorrespondingTo is set to determine if the buffer is an existing recipients/options buffer. Closes jamessan/vim-gnupg#72 Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
parent
454090fe40
commit
e7be112873
@ -1,5 +1,5 @@
|
|||||||
" Name: gnupg.vim
|
" Name: gnupg.vim
|
||||||
" Last Change: 2016 Sep 17
|
" Last Change: 2016 Dec 04
|
||||||
" 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.
|
||||||
@ -799,7 +799,7 @@ function s:GPGEditRecipients()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" only do this if it isn't already a GPGRecipients_* buffer
|
" only do this if it isn't already a GPGRecipients_* buffer
|
||||||
if (match(bufname("%"), "^\\(GPGRecipients_\\|GPGOptions_\\)") != 0 && match(bufname("%"), "\.\\(gpg\\|asc\\|pgp\\)$") >= 0)
|
if (!exists('b:GPGCorrespondingTo'))
|
||||||
|
|
||||||
" save buffer name
|
" save buffer name
|
||||||
let buffername = bufname("%")
|
let buffername = bufname("%")
|
||||||
@ -1026,7 +1026,7 @@ function s:GPGEditOptions()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" only do this if it isn't already a GPGOptions_* buffer
|
" only do this if it isn't already a GPGOptions_* buffer
|
||||||
if (match(bufname("%"), "^\\(GPGRecipients_\\|GPGOptions_\\)") != 0 && match(bufname("%"), "\.\\(gpg\\|asc\\|pgp\\)$") >= 0)
|
if (!exists('b:GPGCorrespondingTo'))
|
||||||
|
|
||||||
" save buffer name
|
" save buffer name
|
||||||
let buffername = bufname("%")
|
let buffername = bufname("%")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user