mirror of
https://github.com/Ascyii/vim-gnupg.git
synced 2025-12-31 22:04:25 -05:00
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:
@@ -1,5 +1,5 @@
|
||||
" Name: gnupg.vim
|
||||
" Last Change: 2016 Sep 17
|
||||
" Last Change: 2016 Dec 04
|
||||
" Maintainer: James McCoy <jamessan@jamessan.com>
|
||||
" Original Author: Markus Braun <markus.braun@krawel.de>
|
||||
" Summary: Vim plugin for transparent editing of gpg encrypted files.
|
||||
@@ -799,7 +799,7 @@ function s:GPGEditRecipients()
|
||||
endif
|
||||
|
||||
" 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
|
||||
let buffername = bufname("%")
|
||||
@@ -1026,7 +1026,7 @@ function s:GPGEditOptions()
|
||||
endif
|
||||
|
||||
" 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
|
||||
let buffername = bufname("%")
|
||||
|
||||
Reference in New Issue
Block a user