chrishrb / gx.nvim

Implementation of gx without the need of netrw
Apache License 2.0
186 stars 19 forks source link

github handler fails to open issue when using gx inside a vim-fugitive git log output #61

Closed reegnz closed 1 month ago

reegnz commented 2 months ago

To reproduce:

Expected:

Actual: I get prompted with the following message:

gx.nvim: No remote git repository found!

And then the plugin continues to open a google search with the text.

reegnz commented 2 months ago

I think I've identified the issue: https://github.com/chrishrb/gx.nvim/blob/ea543829d7eb36c9bf80e43d7a27bd326bb8d3ed/lua/gx/git.lua#L23

With vim-fugitive's :G log this is a temporary file.

Nonetheless the handler should still work within a vim fugitive temp buffer displaying a git log.

reegnz commented 2 months ago

I Propose that the plugin should fall back to the current working directory for path if it fails to discover a git remote on the current path.