Get the path of current file relative to the git root
This commit is contained in:
committed by
Dheepak Krishnamurthy
parent
ad3e1ea592
commit
dc56df433b
@@ -138,8 +138,11 @@ end
|
|||||||
|
|
||||||
--- :LazyGitFilterCurrentFile entry point
|
--- :LazyGitFilterCurrentFile entry point
|
||||||
local function lazygitfiltercurrentfile()
|
local function lazygitfiltercurrentfile()
|
||||||
local current_file = vim.fn.expand("%")
|
local current_dir = vim.fn.expand("%:p:h")
|
||||||
lazygitfilter(current_file)
|
local git_root = get_root(current_dir)
|
||||||
|
local file_path = vim.fn.expand('%:p')
|
||||||
|
local relative_path = string.sub(file_path, #git_root + 2)
|
||||||
|
lazygitfilter(relative_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- :LazyGitConfig entry point
|
--- :LazyGitConfig entry point
|
||||||
|
|||||||
Reference in New Issue
Block a user