@@ -156,17 +156,6 @@ local function entries_to_snack_items(entries)
156
156
return items
157
157
end
158
158
159
- --- Convert snack picker items to entries
160
- --- @param items any[]
161
- --- @return any[]
162
- local function snack_items_to_entries (items )
163
- local entries = {}
164
- for _ , item in ipairs (items ) do
165
- table.insert (entries , item .text )
166
- end
167
- return entries
168
- end
169
-
170
159
--- Utility function to map actions
171
160
--- @param on_select fun ( item : any | nil )
172
161
--- @param allow_multi boolean
@@ -180,11 +169,13 @@ local function snacks_actions(on_select, allow_multi, refocus_status)
180
169
end
181
170
182
171
local function confirm (picker , item )
183
- local selection
172
+ local selection = {}
184
173
local picker_selected = picker :selected { fallback = true }
185
174
186
175
if # picker_selected > 1 then
187
- selection = snack_items_to_entries (picker_selected )
176
+ for _ , item in ipairs (picker_selected ) do
177
+ table.insert (selection , item .text )
178
+ end
188
179
else
189
180
local entry = item .text
190
181
local prompt = picker :filter ().pattern
@@ -195,7 +186,7 @@ local function snacks_actions(on_select, allow_multi, refocus_status)
195
186
or prompt :match (" @" )
196
187
or prompt :match (" :" )
197
188
198
- selection = { (navigate_up_level or input_git_refspec ) and prompt or entry }
189
+ table.insert ( selection , (navigate_up_level or input_git_refspec ) and prompt or entry )
199
190
end
200
191
201
192
if selection and selection [1 ] and selection [1 ] ~= " " then
0 commit comments