Skip to content
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

Add git top-level path when adding cscope #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hygoni
Copy link

@hygoni hygoni commented May 28, 2021

Hello, just made a small change to quickr-cscope.vim.
Pick this if you think it is needed.

I was using it to traverse the linux sources,
but it was difficult to go to function definitions when I was in subdirectories (like drivers/net/....)

Because the file path of function definition is relative, I was not able to open it in subdirectories.
So converted it to absolute path using the git root repository.
(Maybe there's better way because there will be a repository that does not use git)

Can't go to function definition because it's absolute path.
So add top-level path of git when loading cscope.out.
It assumes that cscope.out is in root of git repository.
Comment on lines +61 to +62
let root_path = trim(system("git rev-parse --show-toplevel"))
execute "cs add " . db . " " . root_path
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not want to do this as not all projects use git. cs add already adds the directory of the database file as the relative path.

If you really need this, this needs to be exposed as an option that's turned off by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants