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

Use findfile() and added documenation #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PeterRincker
Copy link

I have added the following:

  • findfile() in cscope_auto#locate_database()
  • support for g:cscope_auto_database_name or b:cscope_auto_database_name
  • Added documentation

@ktchen14
Copy link
Owner

@PeterRincker Whoa thanks for adding documentation for this! The only thing I'm not sure about is whether or not I want to go with findfile() at the moment. The reason is that I'm considering (optionally) making cscope_auto_database_name a list such that either:

let g:cscope_auto_database_name = '.cscope'

Or:

let g:cscope_auto_database_name = ['.cscope', 'mycscope.out']

Would be valid. In the latter case cscope_auto#locate_database() would perform an upward recursive search and would use the first file found called either .cscope or mycscope.out with preference given to .cscope if both are present in the same directory. As far as I can tell this isn't something I can do with findfile(); for example if we have:

/a/b/.cscope
/a/b/c/mycscope.out

And the base directory is /a/b/c then I'd expect to use /a/b/c/mycscope.out since it occurs earlier in the search order. Using findfile() and iterating over the list provided we'd choose /a/b/.cscope instead without some additional logic to compare the lengths of the paths returned by each name.

My thinking is that this may satisfy most use cases requiring a b:cscope_auto_database_name in that you'd just define all the names that you're interested in using once.

Copy link
Owner

@ktchen14 ktchen14 left a comment

Choose a reason for hiding this comment

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

Drop the findfile() commit at 692afd7

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