diff options
Diffstat (limited to '.config')
| -rw-r--r-- | .config/nvim/lua/dotfiles/follow.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/.config/nvim/lua/dotfiles/follow.lua b/.config/nvim/lua/dotfiles/follow.lua index 00e0b9c..51c9972 100644 --- a/.config/nvim/lua/dotfiles/follow.lua +++ b/.config/nvim/lua/dotfiles/follow.lua @@ -107,7 +107,8 @@ end -- edit-type: edit|split|vsplit local function edit_target(target, edit_cmd) local scheme, uri = string.match(target, "^(%a[%w%+%-%.]+)://(.*)") - if scheme ~= nil then -- if the target is a URL (and not a file name) + local target_is_url = scheme ~= nil + if target_is_url then uri = vim.uri_decode(uri) target = scheme .. "://" .. uri end @@ -122,7 +123,10 @@ local function edit_target(target, edit_cmd) end target = resolved end - vim.cmd(edit_cmd .. " " .. vim.fn.fnameescape(target)) + if target_is_url then + target = vim.fn.fnameescape(target) + end + vim.cmd(edit_cmd .. " " .. target) if handler ~= nil and handler.after ~= nil then handler.after() end |
