Added support for ranges when opening a file

This commit is contained in:
Laurent Vauthrin 2023-03-21 09:39:12 -04:00
parent 602cae773b
commit 0882b3d798
2 changed files with 19 additions and 6 deletions

View file

@ -5,9 +5,15 @@ vim.g.openingh = true
local openingh = require("openingh")
vim.api.nvim_create_user_command("OpenInGHFile", function()
openingh:openFile()
end, {})
vim.api.nvim_create_user_command("OpenInGHFile", function(opts)
if opts.range == 0 or opts.range == 1 then
openingh.openFile()
else
openingh.openFile(opts.line1, opts.line2)
end
end, {
range = true,
})
vim.api.nvim_create_user_command("OpenInGHRepo", function()
openingh:openRepo()