diff --git a/lua/dap/utils.lua b/lua/dap/utils.lua index 1ae3aa6f..eb27e961 100644 --- a/lua/dap/utils.lua +++ b/lua/dap/utils.lua @@ -220,8 +220,11 @@ local function get_files(path, opts) if vim.fs.dir then local files = {} for name, type in vim.fs.dir(path, { depth = 50 }) do - if type == "file" and filter(name) then - table.insert(files, vim.fs.joinpath(path, name)) + if type == "file" then + local filepath = vim.fs.joinpath(path, name) + if filter(filepath) then + table.insert(files, vim.fs.joinpath(path, name)) + end end end return files