@@ -160,7 +160,7 @@ where
160160 rc. kill ( )
161161 }
162162 // Clear items
163- self . app . item_pool . clear ( ) ;
163+ // self.app.item_pool.clear();
164164 // Clear displayed items unless no_clear_if_empty is set
165165 if !self . app . options . no_clear_if_empty {
166166 self . app . item_list . clear ( ) ;
@@ -378,24 +378,32 @@ where
378378 // Extract final_key and is_abort from final_event
379379 let is_abort = !matches ! ( & self . final_event, Event :: Action ( Action :: Accept ( _) ) ) ;
380380
381+ let selected_items = self . app . results ( ) ;
382+
383+ let cmd = if self . app . options . interactive {
384+ self . app . input . to_string ( )
385+ } else if self . app . options . cmd_query . is_some ( ) {
386+ self . app . options . cmd_query . clone ( ) . unwrap ( )
387+ } else {
388+ self . initial_cmd . clone ( )
389+ } ;
390+ let query = self . app . input . to_string ( ) ;
391+ let current = self . app . item_list . selected ( ) ;
392+ let header = self . app . header . header . clone ( ) ;
393+ let final_event = self . final_event . clone ( ) ;
394+ let final_key = self . final_key . clone ( ) ;
395+
396+ drop ( self ) ;
397+
381398 SkimOutput {
382- cmd : if self . app . options . interactive {
383- // In interactive mode, cmd is what the user typed
384- self . app . input . to_string ( )
385- } else if self . app . options . cmd_query . is_some ( ) {
386- // If cmd_query was provided, use that for output
387- self . app . options . cmd_query . clone ( ) . unwrap ( )
388- } else {
389- // Otherwise use the execution command
390- self . initial_cmd
391- } ,
392- final_event : self . final_event ,
393- final_key : self . final_key ,
394- query : self . app . input . to_string ( ) ,
399+ cmd,
400+ final_event,
401+ final_key,
402+ query,
395403 is_abort,
396- selected_items : self . app . results ( ) ,
397- current : self . app . item_list . selected ( ) ,
398- header : self . app . header . header . clone ( ) ,
404+ selected_items,
405+ current,
406+ header,
399407 }
400408 }
401409
0 commit comments