jamessan / vim-gnupg

This script implements transparent editing of gpg encrypted files.
http://www.vim.org/scripts/script.php?script_id=3645
728 stars 73 forks source link

Edit recipients buffer is not shown on file open if custom GPGFilePattern is set #72

Closed emilsenan closed 7 years ago

emilsenan commented 7 years ago

Steps to reproduce:

  1. add let g:GPGFilePattern = '*.\(txt\)' to .vimrc
  2. open new file for edit 'vi new.txt'

Result: edit recipients buffer is not shown.

I think reason is that GPGFilePattern variable is not used everywhere, there are still places in plugin code where hardcoded *.\(gpg\|asc\|pgp\) is used instead of GPGFilePattern.

ThomasAH commented 7 years ago

This changeset introduces a bug: When opening test.gpg and using :GPGEditRecipients, vim opens one new (empty!) buffer named "GPGRecipients_test.gpg" and a second new buffer named "GPGRecipients_GPGRecipients_test.gpg" which contains the recipient list.

Edit: And the text in GPGRecipients_GPGRecipients_test.gpg is:

GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
GPG: ----------------------------------------------------------------------
GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
Test <test@example.com>             (ID: 0x1122334455667788 created at Wed 07 Dec 2016 4:00:00 PM CET)
jamessan commented 7 years ago

Hmm, I tested that exact scenario. Can you open a new issue about this and I'll look into it when I have access to my gpg setup?

ThomasAH commented 7 years ago

Filed as issue #75 with some further testing.