-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Watcher attempts to index a nil value #848
Comments
I'm getting this consistently, any time I use Git in a project where I have a file open in Neovim. I can simply open a file and run
It's similar, but perhaps coincidentally related to the above. Either way it's the watcher receiving a nil filename. Printing the
I don't know what a rename of an empty filename means though. I see #823 is about improving the watcher, perhaps this can be resolved there. Also, I'm running on FreeBSD, so maybe the event manager behaves differently? I've been seeing this for many weeks and it happens every time I use Git with a file open. This is my temporary fix: otrho@fa1fd99 |
That fix indicates to me that luv is behaving weirdly. According to https://github.com/luvit/luv/blob/master/docs.md#uvfs_event_startfs_event-path-flags-callback However since it obviously can be |
I updated to the latest version (which includes #851), but I'm still running into the same error message. Not sure if a similar "catch" statement makes sense in this case; as mentioned above, the |
Ah yes, there's a scheduler call before the access which means the buffer may have detached. So to fix this we just need to do a simple buffer check after the scheduler. |
So basically a copy-paste of this: gitsigns.nvim/lua/gitsigns/watcher.lua Lines 60 to 66 in 5d73da7
|
Sort of yes. |
#854 should address a bunch of latent issues. Let me know if it fixes this one. |
Ok. Next time I run into the issue, I'll try reproducing on the new version. |
I'll close this for now. |
Well, I just ran into the issue, updated the plugin, but it still happens. So those fixes didn't change the behavior. |
Same line number? |
Yep, same exact line numbers. Also verified that the plugin repo actually updated to |
Did another attempt at fixing. Please report any problems. |
I believe that has fixed the issue. Thanks! |
Running into this issue as well as of d195f0c; pops up intermittently when I have a lot of files open. If it's of any relevance I only see this happen when working in a large monorepo. |
This happens to me as well together with fugitive:
|
Description
When opening up unstaged files in fugitive, I'll sometimes see the following error message:
It doesn't have a noticeable effect on the buffers as far as I can tell; even the signs in the gutter are still there. It's more just annoying/alarming than anything else.
Looking at the code, it gets caught on this line:
gitsigns.nvim/lua/gitsigns/watcher.lua
Line 86 in 5d73da7
So I assume that it's
cache
that is thenil
value attempting to be indexed. Strangely though,cache
is used and indexed in the same function, just a few lines up:gitsigns.nvim/lua/gitsigns/watcher.lua
Line 68 in 5d73da7
So somehow
cache
becomesnil
between those two lines, but I can't figure out why. Nor can I recreate the issue with any consistency at the moment. I'll try adding to this issue if I find more information or anymore reasonNeovim version
NVIM v0.9.0 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3
Operating system and version
Manjaro 23.0.0
Expected behavior
Not have an error throw when diffing files
Actual behavior
I get the error message listed above. I can hit enter, move on, and nothing appears to be wrong.
Steps to reproduce
Can't find a consistent reproducer unfortunately. I basically diff and stage files until the error occurs.
Gitsigns debug messages
The text was updated successfully, but these errors were encountered: