-
-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
It looks like commit 19872ee I have a helper function defined like this:
local select_dir_for_live_grep = function(_)
local action_state = require("telescope.actions.state")
local current_line = action_state.get_current_line()
local fb = require("telescope").extensions.file_browser
local lg = require("telescope").extensions.live_grep_args
fb.file_browser({
files = false,
hidden = false,
attach_mappings = function(_)
require("telescope.actions").select_default:replace(function()
local entry_path = action_state.get_selected_entry().Path
local dir = entry_path:is_dir() and entry_path or entry_path:parent()
local relative = dir:make_relative(vim.fn.getcwd())
lg.live_grep_args({
cwd = dir:absolute(),
default_text = current_line,
results_title = relative .. "/",
})
end)
return true
end,
})
endAnd the "normal" extension config looks like this:
extensions = {
file_browser = {
attach_mappings = function(_, _)
actions.open_qflist:replace(function()
vim.cmd [[botright copen|cfirst]]
end)
return true
end,
auto_depth = true,
display_stat = false,
grouped = true,
hidden = true,
hide_parent_dir = true,
mappings = {
i = {
['<M-a>'] = fb_actions.create,
['<M-c>'] = fb_actions.copy,
['<M-d>'] = fb_actions.remove,
['<M-r>'] = fb_actions.rename,
},
},
select_buffer = true,
},Previously this worked just fine, but now it only shows the toplevel folders when using the file browser during grep'ing. If I explicitly add the auto_depth = true option to the select_dir_for_live_grep method, nothing changes. But when I add the option depth = 1000 it suddenly works as expected again.
Metadata
Metadata
Assignees
Labels
No labels