Upgraded to 15.9 a couple of days ago through homebrew, and since then, if I hit <ctrl +="" ]=""> to go to the definition of a symbol, if the symbol is not defined, vim freezes. Also happens if I run ":cs find s <undefined symbol".</ctrl>
Also, I can't seem to figure out how to downgrade to the previous version through homebrew since the only formula is 15.9. Is there some way to do that that I'm missing?
This does not reproduce here. Neither in Vim, nor in cscope when used on its own.
This makes it likely that the homebrew port you're using is the problem.
Can confirm that this happens here on macOS with the following steps:
Clone cscope git master at
https://git.code.sf.net/p/cscope/cscope
export EDITOR=vim
Run
cscope -R
to generate an index. Here, I used the root of the ffmpeg git repo.Open
ffmpeg.c
file via "Find this file:"Run ":cs f s <undefined-symbol>" within vim.</undefined-symbol>
Vim freezes / becomes unresponsive and has to be killed.
Was able to bisect and narrow it down to this commit: 6d646e7528f499d6df559cffc43ee11dd424c501
Reverting this one commit makes things work OK again with master. Not sure what a proper fix would be, as I'm unfamiliar with the cscope codebase. Also haven't tested Linux yet, so the issue may be macOS specific.
Some more environment specifics that may be relevant:
macOS Mojave
Mac command-line tools installed, so "gcc" == clang/llvm
* Nix package manager
Reverting that change would be quite obviously the wrong idea. Without that fix, cscope might just crash on the spot, which cannot possibly be correct.
That indicates the actual problem is closer to vim than to cscope, here. I suspect (your version of) the cscope support in vim just don't expect the output "Unable to search database" from its "cscope -l" subprocess.
And indeed, on inspection of the vim sources, they did add code to handle this new response in January of 2018. So: what you really need is a fresher vim.
Compiled a vim from git master, and it seems to work now with cscope master. Thanks for the tip.