From e7be11287357641a97cb3b4cb29a66ce33c395a3 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sun, 4 Dec 2016 13:56:39 -0500 Subject: [PATCH] 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 --- plugin/gnupg.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 4bb3b9a..f26a314 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,5 +1,5 @@ " Name: gnupg.vim -" Last Change: 2016 Sep 17 +" Last Change: 2016 Dec 04 " Maintainer: James McCoy " Original Author: Markus Braun " 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("%")