Added support for ranges when opening a file
This commit is contained in:
parent
602cae773b
commit
0882b3d798
2 changed files with 19 additions and 6 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue