From 4269605b1f583941782c7725025fa38b2c52b5ae Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:41:47 +0100 Subject: [PATCH] fix(moveToFolderInCwd): fix ignoring logic --- lua/genghis/init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/genghis/init.lua b/lua/genghis/init.lua index 4ceb2b6..3412ad7 100644 --- a/lua/genghis/init.lua +++ b/lua/genghis/init.lua @@ -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 })