Skip to content

Commit

Permalink
fix(moveToFolderInCwd): fix ignoring logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Feb 5, 2024
1 parent c19f981 commit 4269605
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/genghis/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down

0 comments on commit 4269605

Please sign in to comment.