Make LazyGitConfig work
This commit is contained in:
@@ -26,8 +26,8 @@ local function project_root_dir()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- try symlinked file location instead
|
-- try symlinked file location instead
|
||||||
local gitdir = fn.system('cd "' .. fn.fnamemodify(fn.resolve(fn.expand('%:p')), ':h') .. '" && git rev-parse --show-toplevel')
|
gitdir = fn.system('cd "' .. fn.fnamemodify(fn.resolve(fn.expand('%:p')), ':h') .. '" && git rev-parse --show-toplevel')
|
||||||
local isgitdir = fn.matchstr(gitdir, '^fatal:.*') == ""
|
isgitdir = fn.matchstr(gitdir, '^fatal:.*') == ""
|
||||||
if isgitdir then
|
if isgitdir then
|
||||||
return trim(gitdir)
|
return trim(gitdir)
|
||||||
end
|
end
|
||||||
@@ -178,11 +178,11 @@ local function lazygitconfig()
|
|||||||
-- directory does not exist
|
-- directory does not exist
|
||||||
fn.mkdir(fn.fnamemodify(config_file, ":h"))
|
fn.mkdir(fn.fnamemodify(config_file, ":h"))
|
||||||
end
|
end
|
||||||
vim.cmd('edit "' .. config_file .. '"')
|
vim.cmd('edit ' .. config_file)
|
||||||
vim.cmd([[execute "silent! 0read !lazygit -c"]])
|
vim.cmd([[execute "silent! 0read !lazygit -c"]])
|
||||||
vim.cmd([[execute "normal 1G"]])
|
vim.cmd([[execute "normal 1G"]])
|
||||||
else
|
else
|
||||||
vim.cmd('edit "' .. config_file .. '"')
|
vim.cmd('edit ' .. config_file)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user