Skip to content

Commit

Permalink
Use buffer number to name the options/recipients buffers
Browse files Browse the repository at this point in the history
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 #89
Signed-off-by: James McCoy <jamessan@jamessan.com>
  • Loading branch information
jamessan committed Jun 23, 2018
1 parent fa3a630 commit e2aec69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/gnupg.vim
@@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e2aec69

Please sign in to comment.