fix(moveToFolderInCwd): fix ignoring logic

remotes/origin/HEAD
Chris Grieser 2024-02-05 15:41:47 +01:00
parent c19f9816bc
commit 4269605b1f
1 changed files with 5 additions and 4 deletions

View File

@ -128,10 +128,11 @@ function M.moveToFolderInCwd()
-- determine destinations in cwd
local subfoldersOfCwd = vim.fs.find(function(name, path)
local ignoreDirs = (path:find("/%.git/") or path:find("/%.git$") or name == ".git")
or (path:find("%.app/") or path:find("%.app$")) -- macos pseudo-apps
or (name == "node_modules" or path:find("node_modules/"))
or (name == ".venv" or path:find("%.venv/"))
local fullPath = path .. "/" .. name .. "/"
local ignoreDirs = fullPath:find("/%.git/")
or fullPath:find("%.app/") -- macos pseudo-apps
or fullPath:find("/node_modules/")
or fullPath:find("/%.venv/")
return not ignoreDirs
end, { type = "directory", limit = math.huge })