chrishrb / gx.nvim

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

bug: git handler does not remove `.git` from the end of https urls #45

Closed sportshead closed 2 months ago

sportshead commented 4 months ago

When I do gx on a comment like -- Fixes 42, the plugin tries to open https://github.com/sportshead/init.lua.git/issues/42, which is a 404. I have my remotes set like this:

$ git remote -v
origin  https://github.com/sportshead/init.lua.git (fetch)
origin  https://github.com/sportshead/init.lua.git (push)

It seems like the regex for http urls is a bit broad: https://github.com/chrishrb/gx.nvim/blob/78070bbd8e7e15a1623cdd6832a9529d2ee63e0c/lua/gx/git.lua#L13

A regex like ^origin\t(.*)(%.git)? would probably work better for this.