lyuts / vim-rtags

Vim bindings for rtags, llvm/clang based c++ code indexer.
BSD 2-Clause "Simplified" License
282 stars 56 forks source link

Navigation does not work if vim is started not from project root. #22

Closed slavasav closed 8 years ago

slavasav commented 8 years ago

When vim is run from some project subfolder and the rc project uses relative file paths the navigation won't work. Probably this can be fixed by running all commands with --absolute-path argument. Example: compile_commands.json contains "file: "../../src"" in a tree structure: project_root --src When vim is run from src and jump to symbol is used, rc will return "src/..", which vim will understand as "src/src/..." and show a new dir.

lyuts commented 8 years ago

Hi @slavasav, are you running the latest version of vim-rtags? Pull request #16 made all rc invocations to use this flag. Also, just to confirm, I tried to reproduce this bug on rtags project, whose root is ~/ws/GIT/rtags. Having started vim from ~/ws/GIT/rtags/src I was able to jump to a definition of a method.

slavasav commented 8 years ago

Oh, I overlooked the update, sorry for that. Works fine, great stuff!