Instructions: Replace the template text and remove irrelevant text (including this line)
Describe the bug
Using vim-go, sometime between Vim versions 8.1.0500
and 8.1.0600
, :GoDef
functionality broke. I know this is a plugin and not necessarily a Vim thing, but I pinned down the change to jumping between those versions of Vim.
The command above is used to jump to the definition of a symbol in a Go file. If the definition is in another file, the file is opened in a new buffer and that buffer is switched to.
The problem I started seeing is that only when jumping to the definition requires opening a new buffer, the new buffer is opened but Vim hangs and doesn't jump to it. If I hit ctrl+c then it jumps to the newly opened file. If the file was already open in another buffer, then everything works as expected. So this only happens when a file is being newly opened in a new buffer.
I guess I'm wondering if anything rings a bell to anyone about anything that may have changed in Vim between 8.1.0500
and 8.1.0600
around the behaviour of opening files in buffers?
To Reproduce
Detailed steps to reproduce the behavior:
:GoInstallBinaries
(sorry, I know this might require some Go setup)r.getPlanPod()
:GoDef
Expected behavior
The file containing the definition is loaded in a new buffer, and vim jumps to the definition in that file
Screenshots
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
can someone bisect the offending commit?
I can't reproduce. I followed the instructions given in the OP, and with this minimal vimrc:
set rtp-=~/.vim
set rtp-=~/.vim/after
set rtp^=/usr/local/share/vim/vim82
set rtp^=/run/user/1000/tmp/vim-go
filetype plugin on
It takes a few seconds for :GoDef
to jump to the definition, but Vim doesn't hang; be it on 8.1.0500 or on 8.1.0600:
Something else must be necessary to reproduce the issue.
Ok through deleting plugins one by one the offender seems to be vim-gitgutter.
I tried to follow the repro steps but had some kind of problem installing the Go dependencies.
I scanned through the git log for the commit range you gave but nothing jumped out at me. If you were able to bisect the offending commit, that would really help.
Also, what commit is your copy of vim-gitgutter at?
Another approach to debugging this would be to profile what's happening. Hopefully that would indicate where things are getting held up.
vim-plug.log
Attached the profile log. I'm no expert in reading this but gitgutter#diff#run_diff()
seems to be the culprit. Here's a second example where I let it sit for longer before hitting ctrl-c:
vim-plug-2.log
There seems to be a while loop that calls gitgutter#utility#repo_path
and that looks like it was called 1163 and 2781 in the first 2 examples respectively, with gitgutter#utility#getbufvar()
right behind it.
Here's an example from when the target file was already loaded in a buffer:
vim-plug-3.log
Also, what commit is your copy of vim-gitgutter at?
Current
HEAD
of master,b356cc9
So I had all that ^ written up and decided to do one more remove/reinstall of the plugin, and now it works 🤦
I'm gonna leave the profile logs here so I don't look crazy 😛 , but I guess sorry for wasting your time (orrrr, hooray, nothing to fix?)
so now it works?
so now it works?
Yep. Not sure why now, I had removed/re-added the plugin several times to confirm it was the culprit and on 2 machines and it was reproducible. But the last one sorted it.
Will close the issue. Thanks and sorry!
Closed #6008.