ruifm / gitlinker.nvim

A lua neovim plugin to generate shareable file permalinks (with line ranges) for several git web frontend hosts. Inspired by tpope/vim-fugitive's :GBrowse
GNU General Public License v3.0
525 stars 44 forks source link

bug fix: use explorer command to open browser in windows #76

Closed linrongbin16 closed 1 year ago

linrongbin16 commented 1 year ago

As mentioned in #75 , open link in windows is not supported for now. I add detection for windows, and use explorer command to open url. Please see: https://stackoverflow.com/a/23039509/4438921

Manually tested: image

image

As showed in picture, the browser is opened correctly. But the url is actually wrong. In Windows, the path separator is \ instead of /.

Any way this command should be good.

linrongbin16 commented 1 year ago

After read lua/gitlinker/git module, I found it use many / to match the git link and file path. It should be a big effort if we want to support windows.

linrongbin16 commented 1 year ago

We can also refer to urlview.nvim's open in browser implementation