cleanup
This commit is contained in:
@@ -352,7 +352,11 @@ do
|
|||||||
cargo={'Cargo.toml'},
|
cargo={'Cargo.toml'},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@param dir string?
|
||||||
|
---@param glob_pattern string
|
||||||
|
---@return boolean
|
||||||
local function file_exists(dir, glob_pattern)
|
local function file_exists(dir, glob_pattern)
|
||||||
|
if dir == nil then return false end
|
||||||
return vim.fn.globpath(dir, glob_pattern, false, false, false) ~= ''
|
return vim.fn.globpath(dir, glob_pattern, false, false, false) ~= ''
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -369,14 +373,11 @@ do
|
|||||||
---@return integer?
|
---@return integer?
|
||||||
---@return string?
|
---@return string?
|
||||||
local function iter(_, i)
|
local function iter(_, i)
|
||||||
i = i + 1
|
if file_exists(folders[i], '.git') then
|
||||||
local f = folders[i]
|
|
||||||
if f == nil then
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
if file_exists(f, '.git') then
|
i = i + 1
|
||||||
i = -1
|
local f = folders[i]
|
||||||
end
|
|
||||||
return i, f
|
return i, f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user