Skip to content

Commit

Permalink
Merge pull request #78 from dominik-schwabe/main
Browse files Browse the repository at this point in the history
fix: Ignore invalid file paths
  • Loading branch information
ahmedkhalf authored Apr 4, 2023
2 parents 1c2e9c9 + e366fce commit 8c6bad7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lua/project_nvim/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function M.on_buf_enter()
end

local current_dir = vim.fn.expand("%:p:h", true)
if path.is_excluded(current_dir) then
if not path.exists(current_dir) or path.is_excluded(current_dir) then
return
end

Expand Down
4 changes: 4 additions & 0 deletions lua/project_nvim/utils/path.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ function M.is_excluded(dir)
return false
end

function M.exists(path)
return vim.fn.empty(vim.fn.glob(path)) == 0
end

return M

0 comments on commit 8c6bad7

Please sign in to comment.