Skip to content

Conversation

@gjeusel
Copy link

@gjeusel gjeusel commented Nov 11, 2022

Hello back ! Following the issue, the solution I came with.
Allowing to pass a function as the cwd, and when the function returns a nil, it should not trigger the rg run.

It can be used as follow:

require("cmp").setup({
  sources = {
    {
      name = "rg",
      options = {
        cwd = find_root_dir,  -- use rg only if find git in parent dir
      },
    },
  }
}

@lukas-reineke
Copy link
Owner

Thank you,

I still prefer this to be in cmp directly, like discussed in #27, but this might be a good workaround for the time being. 🤔
Let me think about this a bit.

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.

2 participants