From 79193b3917d0f1b82ee41b4e64ae4df58f2284f6 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 17 Mar 2025 21:10:32 +0800 Subject: [PATCH] feat: make `git.yazi` work in the search view (compatible with `vcs-files.yazi`) --- git.yazi/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git.yazi/main.lua b/git.yazi/main.lua index 0b023d9..b301f13 100644 --- a/git.yazi/main.lua +++ b/git.yazi/main.lua @@ -158,7 +158,7 @@ local function setup(st, opts) Linemode:children_add(function(self) local url = self._file.url - local repo = st.dirs[tostring(url:parent())] + local repo = st.dirs[tostring(url.base or url:parent())] -- TODO: remove this local code if repo then code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)] @@ -175,7 +175,7 @@ local function setup(st, opts) end local function fetch(_, job) - local cwd = job.files[1].url:parent() + local cwd = job.files[1].url.base or job.files[1].url:parent() -- TODO: remove this local repo = root(cwd) if not repo then remove(tostring(cwd))