erig0 / cscope_dynamic

Automatic dynamic cscope updates for Vim
25 stars 12 forks source link

[Vim-8.1] .cscope.big.files is empty #3

Open derkling opened 6 years ago

derkling commented 6 years ago

I'm using this plugin to index a Linux kernel source tree with success using VIM 8. Since I've switched to VIM 8.1, the creation of .cscope.big.files generates an empty file... and thus no DB.

Still to investigate on possible issues.

derkling commented 6 years ago

The issue seems to be related to my shell, I use ZSH instead of BASH, and by using VIM 8.1 the exec command seems to spawns a ZSH... which was not the case with VIM 8.0.

When the find command is executed on ZSH, it fails with:

zsh: no matches found: *.c

This is the complete command we build:

(set -f;find  .  -name *.c   -or -name *.h -or -name *.C   -or -name *.H -or -name *.c++ -or -name *.h++ -or -name *.cxx -or -name *.hxx -or -name *.cc  -or -name  *.hh -or -name *.cpp -or -name *.hpp -type f| cat - | xargs realpath --relative-to=$(pwd) > .cscope.big.files && nice cscope -kqbR -u -i.cscope.big.files -f.cscope.big; rm .cscopedb.lock) &>/dev/null &

Thus I guess there is some issue with the escaping of the wildcards... which needs to be more robust wrt the shell in use.

Will try to provide a fix for that.

For the time being, a workaround working for me is:

ZSH$> exec bash 
BASH$> SHELL=/bin/bash /path/to/my/vim81
balsini commented 6 years ago

Thanks @derkling , that's cool. I was experiencing the same issue! My workaround is a set shell=/bin/bash in the .vimrc.