mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-06 03:38:16 +00:00
fix(explorer): disable follow for explorer search by default. No longer needed. Link directories may show as files then though, but that's not an issue. See #960
This commit is contained in:
parent
4a6ed6912e
commit
b9a17d82a7
1 changed files with 3 additions and 4 deletions
|
@ -259,7 +259,6 @@ function M.search(opts, ctx)
|
||||||
"d", -- include directories
|
"d", -- include directories
|
||||||
"--path-separator", -- same everywhere
|
"--path-separator", -- same everywhere
|
||||||
"/",
|
"/",
|
||||||
"--follow", -- always needed to make sure we see symlinked dirs as dirs
|
|
||||||
}
|
}
|
||||||
opts.dirs = { ctx.filter.cwd }
|
opts.dirs = { ctx.filter.cwd }
|
||||||
ctx.picker.list:set_target()
|
ctx.picker.list:set_target()
|
||||||
|
@ -295,12 +294,12 @@ function M.search(opts, ctx)
|
||||||
else
|
else
|
||||||
item.sort = parent.sort .. "#" .. basename .. " "
|
item.sort = parent.sort .. "#" .. basename .. " "
|
||||||
end
|
end
|
||||||
if basename:sub(1, 1) == "." then
|
item.hidden = basename:sub(1, 1) == "."
|
||||||
item.hidden = true
|
|
||||||
end
|
|
||||||
item.text = item.text:sub(1, #opts.cwd) == opts.cwd and item.text:sub(#opts.cwd + 2) or item.text
|
item.text = item.text:sub(1, #opts.cwd) == opts.cwd and item.text:sub(#opts.cwd + 2) or item.text
|
||||||
local node = Tree:node(item.file)
|
local node = Tree:node(item.file)
|
||||||
if node then
|
if node then
|
||||||
|
item.dir = node.dir
|
||||||
|
item.type = node.type
|
||||||
item.status = (not node.dir or opts.git_status_open) and node.status or nil
|
item.status = (not node.dir or opts.git_status_open) and node.status or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue