Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew-Daniels committed Oct 12, 2024
1 parent 2d183c5 commit 1471bf1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lua/octo/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1669,10 +1669,20 @@ end
function M.copy_url()
local bufnr = vim.api.nvim_get_current_buf()
local buffer = octo_buffers[bufnr]
if not buffer then
return
local url

if buffer then
url = buffer.node.url
else
local host = utils.get_remote_host()
local remote_name = utils.get_remote_name()
if not host or not remote_name then
utils.error "No remote repository found"
return
end
url = "https://" .. host .. "/" .. remote_name
end
local url = buffer.node.url

vim.fn.setreg("+", url, "c")
utils.info("Copied URL '" .. url .. "' to the system clipboard (+ register)")
end
Expand Down

0 comments on commit 1471bf1

Please sign in to comment.