Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of locking #100

Open
cdown opened this issue Mar 20, 2019 · 2 comments
Open

Lack of locking #100

cdown opened this issue Mar 20, 2019 · 2 comments

Comments

@cdown
Copy link

cdown commented Mar 20, 2019

Usually in vim, one can't open the same file twice because a swap file is present, and one gets a warning on the second open (ie. the "Another program may be editing the same file" warning). This is not foolproof, but it generally works.

However, this doesn't happen when editing files with vim-gnupg -- it's possible to open the same file multiple times. Makes sense, since the normal version is implemented using swap files, but perhaps there should be some other form of synchronisation.

Not a massive deal for my use case, since I can just add flocking externally, but I'm not sure if this is intentional or an oversight :-)

@jamessan
Copy link
Owner

Not a massive deal for my use case, since I can just add flocking externally, but I'm not sure if this is intentional or an oversight :-)

It's a side effect of disabling swap files. An interesting possibility might be to use a new buffer for the unencrypted contents and maintain the swapfile on the encrypted buffer.

I'm not sure how feasible that would be nor how much work it would take.

@hlein
Copy link

hlein commented Oct 24, 2019

I have been bitten by this as well.

It seems like what's wanted here is for vim to support locking-without-swapfile, or perhaps, swapfile-without-contents.

That smells like a job for a new/distinct vim plugin, which vim-gnupg could then make use of. I'm kind of surprised that doesn't exist already, but I couldn't find such a thing. There is some discussion of adding flock-style locking to vim, which might or might not be viable here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants