@@ -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
0 commit comments