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 <jamessan@jamessan.com>
This commit is contained in:
James McCoy 2018-06-22 21:53:51 -04:00
parent fa3a63039d
commit e2aec69d2d
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -1,5 +1,5 @@
" Name: gnupg.vim
" Last Change: 2018 Jan 23
" Last Change: 2018 Jun 22
" Maintainer: James McCoy <jamessan@jamessan.com>
" Original Author: Markus Braun <markus.braun@krawel.de>
" 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