You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for vim-gnupg! I'm one of the coauthors of vimwiki and am using both plugins in combination. Recently I found one serve problem of doing so: vimwiki#556 when saving an encrypted wikipage with a TOC beeing auto-updated the page content is lost.
I looked into it: vimwikis autocommand is called by vim-gnupgs autocommand and seem to run correctly. Then vim-gnupg uses '[,']write ! to write to gnupg:
'[,'] is the last changed or yanked text. I don't get why you do this. With a simple write ! the problem is gone – but I assume there's a reason for this code?
The text was updated successfully, but these errors were encountered:
This is documented in :help FileWriteCmd, and is to allow writing a partial file to disk. This is partly a Vim bug and partly a plugin bug.
For the plugin side, I can change to clearly differentiate between BufWriteCmd and FileWriteCmd. This could potentially still be a problem if the user does :'<,'>w foo and your plugin then changes that '[ and '] refer to.
The part that's a Vim bug is that you can't (yet) use :lockmarks to preserve these marks. I've been working on fixing that, but haven't completed the code so I can propose it to Bram.
For the plugin side, I can change to clearly differentiate between BufWriteCmd and FileWriteCmd. This could potentially still be a problem if the user does :'<,'>w foo and your plugin then changes that '[ and '] refer to.
This sounds like a really good solution for now. Writes in the form of :'<,'>w foo are really rare compared to normal writes, so this would fix it for nearly all cases.
The part that's a Vim bug is that you can't (yet) use :lockmarks to preserve these marks. I've been working on fixing that, but haven't completed the code so I can propose it to Bram.
That seems like the proper thing. But until this reaches users one time – I'd like to have the BufWriteCmd/FileWriteCmd`-split.
BufWriteCmd writes the whole buffer, so it can use the bare ":w". Other
plugins may manipulate the '[/'] marks on save, which can cause the
write with marks to not write the entire buffer.
Closes: #96
Signed-off-by: James McCoy <jamessan@jamessan.com>
Hi,
Thanks for vim-gnupg! I'm one of the coauthors of vimwiki and am using both plugins in combination. Recently I found one serve problem of doing so: vimwiki#556 when saving an encrypted wikipage with a TOC beeing auto-updated the page content is lost.
I looked into it: vimwikis autocommand is called by vim-gnupgs autocommand and seem to run correctly. Then vim-gnupg uses
'[,']write !
to write to gnupg:vim-gnupg/plugin/gnupg.vim
Line 749 in 22cbc6b
'[,']
is the last changed or yanked text. I don't get why you do this. With a simplewrite !
the problem is gone – but I assume there's a reason for this code?The text was updated successfully, but these errors were encountered: