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

Breaks swapchoice setting? #73

Open
nfischer opened this issue Oct 11, 2017 · 2 comments
Open

Breaks swapchoice setting? #73

nfischer opened this issue Oct 11, 2017 · 2 comments

Comments

@nfischer
Copy link

Not sure why this is happening, but I'm pretty sure this plugin breaks the v:swapchoice varaible.

I have a section of code in my vimrc like:

augroup NoSimultaneousEdits
  autocmd!
  autocmd SwapExists * let v:swapchoice = 'o'
augroup END

Here's some online explanation.

It looks like vim (and nvim) no longer respect the swapchoice setting when this plugin is loaded. It works for 'q' and 'a' (I didn't try others), but not 'o' (probably the most common choice). Any idea what's going on here?

@bogado
Copy link
Owner

bogado commented Oct 11, 2017

The plug-in is trying to rewrite the file you're opening. When you do "vim file.txt:20" vim tries to open a file with that exact name.

This plug-in will capture those and if a file named "file.txt" exists it will replace the new file that was just created with the previously existent file and jump to line 20.

The problem is that those manipulations confuse vim events and some weird things happen.

I've tried two different strategies for the substitution to happen, but both have some weird side effect.

@nfischer
Copy link
Author

Any way to fix this?

At the very least, it might be good to add a warning in documentation. The SwapExists thing is relatively common.


Also, thanks for the awesome plugin!

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

No branches or pull requests

2 participants