-
Notifications
You must be signed in to change notification settings - Fork 82
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
Python error popping when oppening a file #92
Comments
Let's analyze this! First off, yeah, printing errors over the screen is not nice. The problem is that the errors stems not from neovim-remote, but its only dependency pynvim. Anyway, the last line (in the gif) says Even knowing that, I can't really reproduce it yet. Because when I try to open a file that has a swap file, I get the usual choice of |
Thanks, will post the content of |
Hey @mhinz Now it blocks on:
Once I press enter it gets into read-only mode. The swap file contains some references to vim 8.
Removing the swap file manually always fixes the problem. |
With the default value of Can you put this in your vimrc and try to reproduce it once again?
I think with this you should get a proper |
Opposed to Vim, 'F' is set by default in Nvim. But in combination with the API, the "swap file exists" dialog wouldn't appear for some reason. References #92
Okay, I just pushed the workaround that nvr itself sets That said, if you have many swap files, you're doing something wrong. ;-) E.g. some terminal emulators simply kill their child processen when they get closed. |
Updated. Thanks 👍
I have noticed the swap files existing even when there aren't any vims open. That said, and with the intention to be openhearted and not cocky, why would Couldn't vim discard swap files if there isn't an active buffer related to that file? |
When you open a file, the corresponding swap file gets created, and usually it's removed again when the file buffer gets closed. In the best case your swap directory would be empty. Their sole purpose is to recover files that might have been corrupted during an unexpected close of Vim (segfault in Vim due to a bug, terminal killing Vim on closing, blackout, etc.) So, when all Vims are closed and you still have swap files, feel free to remove them.
I absolutely consider this a Nvim bug or rather a bug in pynvim. My latest commit is merely a workaround. When you just do |
I got stuck in a mindset where it's main purpose was to warn you that you're editing a file that |
Okay, so I had a conversation with @bfredl (a pynvim developer). The situation is complicated. :-P neovim-remote uses pynvim to talk to nvim. pynvim uses nvim's RPC function BTW, in your above case, Nvim wasn't blocking, the dialog was in effect, but the text wasn't shown. So it waited for pressing Long story short, |
This is needed as a workaround in case the "swap file exists" dialog is in effect but the actual text isn't shown. References #92
I also just learned that it's already fixed on master! neovim/neovim#9034 We both tested with the 0.3.1 release. So, the above workaround won't even be needed for the upcoming release. |
I consider this fixed. I'll remove the workaround in the next release after 0.3.2 (which is to be released in the next days) gets released. Thanks for bringing this up! |
**Why** is the change needed? Based on my understanding of mhinz#92 (comment), this workaround is no longer needed. Being able to set `shortmess` is useful for example when running in tmux. Closes mhinz#153
Am getting unexpected behavior sometimes when using neovim-remote.
I haven't yet traced the exact series of steps on how to reproduce it.
Config/versions:
Error
I have filtered out this error message, it usually comes pushed into the text of the opened file.
In the video, I need to press enter to get from the welcome screen to the opened file with the error.
I have noticed that this doesn't happen for new files.
The text was updated successfully, but these errors were encountered: