petertriho / cmp-git

Git source for nvim-cmp
MIT License
397 stars 23 forks source link

feat: use gh repo set-default if set for GitHub #62

Closed kbenzie closed 7 months ago

kbenzie commented 7 months ago

When working in a fork of a GitHub repo, depending on how the remotes are configured locally, completion of issues and pull requests may not work because the fork is being used for the lookup.

This patch checks the value of gh repo set-default --view and uses that instead of the git info discovered in the cmp_git.utils.git_git_info() function. If the default repo has not previously been configured, the command to view it will fail no change is made to the git info.

kbenzie commented 7 months ago

Caveats, I don't use octo.nvim so have only tested this outside of that context.

petertriho commented 7 months ago

LGTM. Thank you for the PR