Skip to content

Commit c0a3b81

Browse files
committed
wip
1 parent 904824c commit c0a3b81

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

lua/telescope/builtin/files.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ files.file_browser = function(opts)
212212
opts = opts or {}
213213

214214
opts.cwd = opts.cwd and vim.fn.expand(opts.cwd) or vim.loop.cwd()
215-
216-
local gen_new_finder = function(path)
215+
opts.new_finder = opts.new_finder or function(path)
217216
opts.cwd = path
218217
local data = {}
219218

@@ -242,8 +241,8 @@ files.file_browser = function(opts)
242241
end
243242

244243
pickers.new(opts, {
245-
prompt_title = 'Find Files',
246-
finder = gen_new_finder(opts.cwd),
244+
prompt_title = 'File Browser',
245+
finder = opts.new_finder(opts.cwd),
247246
previewer = conf.file_previewer(opts),
248247
sorter = conf.file_sorter(opts),
249248
attach_mappings = function(prompt_bufnr, map)
@@ -253,7 +252,7 @@ files.file_browser = function(opts)
253252
local new_cwd = vim.fn.expand(action_state.get_selected_entry().path:sub(1, -2))
254253
local current_picker = action_state.get_current_picker(prompt_bufnr)
255254
current_picker.cwd = new_cwd
256-
current_picker:refresh(gen_new_finder(new_cwd), { reset_prompt = true })
255+
current_picker:refresh(opts.new_finder(new_cwd), { reset_prompt = true })
257256
end)
258257

259258
local create_new_file = function()
@@ -276,7 +275,7 @@ files.file_browser = function(opts)
276275
Path:new(fpath:sub(1, -2)):mkdir({ parents = true })
277276
local new_cwd = vim.fn.expand(fpath)
278277
current_picker.cwd = new_cwd
279-
current_picker:refresh(gen_new_finder(new_cwd), { reset_prompt = true })
278+
current_picker:refresh(opts.new_finder(new_cwd), { reset_prompt = true })
280279
end
281280
end
282281

lua/telescope/finders.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ finders.new_oneshot_job = function(command_list, opts)
156156
opts = opts or {}
157157

158158
assert(not opts.results, "`results` should be used with finder.new_table")
159-
assert(not opts.static, "`static` should be used with finder.new_oneshot_job")
160159

161160
command_list = vim.deepcopy(command_list)
162161
local command = table.remove(command_list, 1)

lua/telescope/finders/async_oneshot_finder.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ return function(opts)
2222
local job_started = false
2323
local job_completed = false
2424
return setmetatable({
25-
close = function() end,
25+
close = function() results = nil; job_started = false end,
2626
results = results,
2727
}, {
2828
__call = void(async(function(_, prompt, process_result, process_complete)

lua/telescope/pickers.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ function Picker:refresh(finder, opts)
640640
self.finder = finder
641641

642642
-- TODO: Need to do on_lines
643-
-- self.__on_lines(nil, nil, nil, 0, 1)
643+
self.__on_lines(nil, nil, nil, 0, 1)
644644
end
645645

646646
function Picker:set_selection(row)
@@ -944,7 +944,7 @@ function Picker:get_result_processor(find_id, prompt, status_updater)
944944
local file = type(entry.value) == 'string' and entry.value or entry.filename
945945
if file then
946946
if string.find(file, v) then
947-
log.debug("SKIPPING", entry.value, "because", v)
947+
log.trace("SKIPPING", entry.value, "because", v)
948948
self:_decrement("processed")
949949
return
950950
end

0 commit comments

Comments
 (0)