From e2aec69d2d0f49dbc61916eadd17c8868f077fe4 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Fri, 22 Jun 2018 21:53:51 -0400 Subject: [PATCH] Use buffer number to name the options/recipients buffers Since buffer numbers are unique in Vim, there's no concern about collisions between options/recipients buffers for different encrypted buffers. This also resolves an issue where opening the options buffer would trigger the recipients buffer (due to the buffer name matching g:GPGFilePattern. Closes jamessan/vim-gnupg#89 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 f57d798..f6b0eb3 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1,5 +1,5 @@ " Name: gnupg.vim -" Last Change: 2018 Jan 23 +" Last Change: 2018 Jun 22 " Maintainer: James McCoy " Original Author: Markus Braun " Summary: Vim plugin for transparent editing of gpg encrypted files. @@ -843,7 +843,7 @@ function s:GPGEditRecipients() if (!exists('b:GPGCorrespondingTo')) " save buffer name - let buffername = bufname("%") + let buffername = bufnr("%") let editbuffername = "GPGRecipients_" . buffername " check if this buffer exists @@ -1058,7 +1058,7 @@ function s:GPGEditOptions() if (!exists('b:GPGCorrespondingTo')) " save buffer name - let buffername = bufname("%") + let buffername = bufnr("%") let editbuffername = "GPGOptions_" . buffername " check if this buffer exists