snailed
/
taolf
Archived
2
0
Fork 0

clean up __open_in, still untested

This commit is contained in:
Luca Bilke 2024-01-29 10:06:55 +01:00
parent ca6553f126
commit 612456bb25
1 changed files with 3 additions and 11 deletions

View File

@ -80,7 +80,6 @@ function Lf:__open_in(path)
if path then
if path == "gwd" then
vim.fn.system("touch /home/luca/fuck")
local gitdir = fn.system(("git -C %s rev-parse --show-toplevel"):format(file_wd))
if gitdir:match("^fatal:.*") ~= nil then
require("util").error("Failed to find git working directory.")
@ -90,18 +89,11 @@ function Lf:__open_in(path)
end
elseif path == "cwd" then
path = file_wd
elseif type(path) == "string" then
path = fn.expand(path)
end
end
local stat = uv.fs_stat(path)
if not type(stat) == "table" then
local cwd = uv.cwd() --[[@as string]]
stat = uv.fs_stat(cwd)
path = cwd
end
else
path = self.term.dir
if path == nil or type(uv.fs_stat(path)) ~= "table" then
path = uv.cwd()
end
self.term.dir = path