@@ -7,8 +7,6 @@ local M = {}
77
88M .selected_entries = {}
99
10-
11-
1210function M .copy_contents_of_selected_files ()
1311 local contents = {}
1412 local paths = {}
@@ -30,13 +28,12 @@ function M.copy_contents_of_selected_files()
3028
3129
3230 local all_contents = table.concat (contents , " \n\n " )
33- vim .fn .setreg (" + " , all_contents )
31+ vim .fn .setreg (config . get_config (). register , all_contents )
3432
3533 if vim .tbl_isempty (contents ) then
3634 vim .api .nvim_echo ({ { " No files were copied" , " WarningMsg" } }, true , {})
3735 return
3836 else
39- -- message to print the paths of the copied files in a bullet list
4037 local message = " Copied the contents of the following files:\n "
4138 for _ , path in ipairs (paths ) do
4239 message = message .. " - " .. path .. " \n "
@@ -57,15 +54,12 @@ function M.copy_all_files(prompt_bufnr)
5754 return
5855 end
5956
60- -- Select all entries
6157 for _ , entry in ipairs (entries ) do
6258 M .selected_entries [entry .value ] = true
6359 end
6460
65- -- Now copy the contents
6661 M .copy_contents_of_selected_files ()
6762
68- -- Close the picker
6963 actions .close (prompt_bufnr )
7064 M .selected_entries = {}
7165end
@@ -228,8 +222,7 @@ function M.attach_mappings(prompt_bufnr, map)
228222 key = cfg .keymaps .toggle_hidden ,
229223 action = function ()
230224 config .toggle_hidden ()
231- -- refresh the picker
232- local current_picker = action_state .get_current_picker (prompt_bufnr )
225+
233226 local rg_command
234227 if config .get_state ().hide_hidden_files then
235228 rg_command = { " rg" , " --files" , " --hidden" , " --glob" , " !.git/*" , " --glob" , " !node_modules/*" ,
@@ -242,6 +235,7 @@ function M.attach_mappings(prompt_bufnr, map)
242235 table.insert (rg_command , opt )
243236 end
244237
238+ local current_picker = action_state .get_current_picker (prompt_bufnr )
245239 current_picker :refresh (finders .new_oneshot_job (rg_command ))
246240
247241 if config .get_state ().hide_hidden_files then
0 commit comments