feat: support OpenInGHFileLines command

This commit is contained in:
Ali Almohaya 2023-05-26 22:31:02 +03:00
parent 374c081409
commit b9daa9db78
No known key found for this signature in database
GPG key ID: 4B80BC43FC6007E0
3 changed files with 19 additions and 2 deletions

View file

@ -15,6 +15,16 @@ end, {
range = true,
})
vim.api.nvim_create_user_command("OpenInGHFileLines", function(opts)
if opts.range == 0 then -- Nothing was selected
openingh.open_file(opts.line1)
else -- Current line or block was selected
openingh.open_file(opts.line1, opts.line2)
end
end, {
range = true,
})
vim.api.nvim_create_user_command("OpenInGHRepo", function()
openingh.open_repo()
end, {})