Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open in browser failed in windows #75

Closed
linrongbin16 opened this issue Feb 18, 2023 · 2 comments
Closed

Open in browser failed in windows #75

linrongbin16 opened this issue Feb 18, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@linrongbin16
Copy link

Describe the bug
Open git link in browser in Windows 10.

To Reproduce

Use Lazy.nvim to install gitlinker.nvim, here's part of lazy's plugins.lua:

    {
        'ruifm/gitlinker.nvim',
        lazy = true,
        dependencies = { 'nvim-lua/plenary.nvim' },
        config = function()
            require('repo/ruifm/gitlinker-nvim/config')
        end,
        keys = require('repo/ruifm/gitlinker-nvim/keys')
    },

Here's the lua/repo/ruifm/gitlinker-nvim/config:

require("gitlinker").setup({
    mappings = "<leader>gL",
})

Here's the lua/repo/ruifm/gitlinker-nvim/keys:

local map_lazy = require("conf/keymap").map_lazy

local M = {
    { "<leader>gL", nil, { "n", "v" }, desc = "Copy git link to clipboard" },
    { "<leader>gl", '<cmd>lua require"gitlinker".get_buf_range_url("n", {action_callback = require"gitlinker.actions".open_in_browser})<cr>', 'n', { silent = true, desc = "Open git link in browser" },
    { "<leader>gl", '<cmd>lua require"gitlinker".get_buf_range_url("v", {action_callback = require"gitlinker.actions".open_in_browser})<cr>',, 'v', { silent = true, desc = "Open git link in browser" },
}

return M

There's an error xdg-open throwed from plenary.nvim.

Expected behavior
Correctly open git link in browser.

Screenshots
image

System (please complete the following information):

  • OS: Windows 10 Enterprise, x86_64, with latest updates and drivers.
  • neovim --version: NVIM v0.9.0-dev-991+g44da6a56b (develop build in 2023-02-18)
  • git --version: git version 2.38.1.windows.1

Additional context
N/A

@linrongbin16
Copy link
Author

Submit a PR #76 , try to fix this issue using explorer command in Windows.

@linrongbin16
Copy link
Author

stevanmilic pushed a commit to stevanmilic/gitlinker.nvim that referenced this issue Nov 12, 2023
* fix(logger): remove 'error!' prefix

* fix(git): fix command line running cwd

* refactor(util): rewrite path relative, normalize util functions

* fix(path): fix symlink resolve in Windows

* refactor(lint): fix typecheck

* refactor(lint): fix typecheck

* test(spawn): fix test cases

* fix(spawn): set 'cwd' options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants