changed the behavior to make the plugin follow the current repository of the current buffer
This commit is contained in:
parent
3a0a1d22c7
commit
28547d2d07
2 changed files with 14 additions and 1 deletions
7
doc/tags
Normal file
7
doc/tags
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
openingh openingh.txt /*openingh*
|
||||||
|
openingh-commands openingh.txt /*openingh-commands*
|
||||||
|
openingh-introduction openingh.txt /*openingh-introduction*
|
||||||
|
openingh-license openingh.txt /*openingh-license*
|
||||||
|
openingh-requirements openingh.txt /*openingh-requirements*
|
||||||
|
openingh-usage openingh.txt /*openingh-usage*
|
||||||
|
openingh.txt openingh.txt /*openingh.txt*
|
||||||
|
|
@ -2,7 +2,9 @@ local utils = require("openingh.utils")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.setup()
|
function M.setup()
|
||||||
local repo_url = vim.fn.system("git config --get remote.origin.url")
|
-- get the current working directory and set the url
|
||||||
|
local current_buffer = vim.fn.expand('%:p:h')
|
||||||
|
local repo_url = vim.fn.system("git -C " ..current_buffer.. " config --get remote.origin.url" )
|
||||||
|
|
||||||
if repo_url:len() == 0 then
|
if repo_url:len() == 0 then
|
||||||
M.is_no_git_origin = true
|
M.is_no_git_origin = true
|
||||||
|
|
@ -19,6 +21,8 @@ function M.setup()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.openFile()
|
function M.openFile()
|
||||||
|
-- make sure to update the current directory
|
||||||
|
M.setup()
|
||||||
if M.is_no_git_origin then
|
if M.is_no_git_origin then
|
||||||
utils.print_no_remote_message()
|
utils.print_no_remote_message()
|
||||||
return
|
return
|
||||||
|
|
@ -45,6 +49,8 @@ function M.openFile()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.openRepo()
|
function M.openRepo()
|
||||||
|
-- make sure to update the current directory
|
||||||
|
M.setup()
|
||||||
if M.is_no_git_origin then
|
if M.is_no_git_origin then
|
||||||
utils.print_no_remote_message()
|
utils.print_no_remote_message()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue