Skip to content

Commit

Permalink
feat(nvim-lua#560): scandir adds link entry if it is a directory.
Browse files Browse the repository at this point in the history
scandir main function (sync only) adds symlinks directories when
found. It does not apply any recursion whatsoever.
  • Loading branch information
SalOrak committed Mar 8, 2024
1 parent f7adfc4 commit 61fe65e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/plenary/scandir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ local gen_search_pat = function(pattern)
end

local process_item = function(opts, name, typ, current_dir, next_dir, bp, data, giti, msp)
if typ == "link" and opts.links then
local entry = uv.fs_readlink(current_dir .. "/" .. name)
local ln_type = uv.fs_stat(entry).type
if ln_type == "directory" then
table.insert(data, entry)
end
end
if opts.hidden or name:sub(1, 1) ~= "." then
if typ == "directory" then
local entry = current_dir .. os_sep .. name
Expand Down

0 comments on commit 61fe65e

Please sign in to comment.