@@ -659,81 +659,6 @@ function M.send_at_mention_for_visual_selection(line1, line2)
659
659
return false
660
660
end
661
661
662
- -- Special handling for mini.files: use integrations module instead of selection system
663
- local current_ft = vim .bo .filetype
664
- local current_buf_name = vim .api .nvim_buf_get_name (vim .api .nvim_get_current_buf ())
665
-
666
- if current_ft == " minifiles" or current_buf_name :match (" ^minifiles://" ) then
667
- local integrations = require (" claudecode.integrations" )
668
- local files , err
669
-
670
- if line1 and line2 then
671
- -- Range-based selection, get files directly using the range
672
- files , err = integrations ._get_mini_files_selection_with_range (line1 , line2 )
673
- else
674
- -- No range provided, try to get last visual selection range
675
- local last_visual_start = vim .fn .line (" '<" )
676
- local last_visual_end = vim .fn .line (" '>" )
677
-
678
- if last_visual_start > 0 and last_visual_end > 0 and last_visual_start <= last_visual_end then
679
- files , err = integrations ._get_mini_files_selection_with_range (last_visual_start , last_visual_end )
680
- else
681
- -- Fall back to current mode detection
682
- files , err = integrations .get_selected_files_from_tree ()
683
- end
684
- end
685
-
686
- if err then
687
- logger .error (" selection" , " Failed to get mini.files selection: " .. err )
688
- return false
689
- end
690
-
691
- if not files or # files == 0 then
692
- logger .warn (" selection" , " No files selected in mini.files." )
693
- return false
694
- end
695
-
696
- -- Send files sequentially with proper delays
697
- local success_count = 0
698
- local total_count = # files
699
-
700
- local function send_next_file (index )
701
- if index > total_count then
702
- -- All files processed, show summary
703
- if success_count > 0 then
704
- local message = success_count == 1 and " Added 1 file from mini.files"
705
- or string.format (" Added %d files from mini.files" , success_count )
706
- logger .info (" selection" , message )
707
- else
708
- logger .error (" selection" , " Failed to send any mini.files selections." )
709
- end
710
- return
711
- end
712
-
713
- local file_path = files [index ]
714
- local success , error_msg = claudecode_main .send_at_mention (file_path , nil , nil , " ClaudeCodeSend" )
715
- if success then
716
- success_count = success_count + 1
717
- logger .debug (" selection" , " Sent mini.files selection: " .. file_path )
718
- else
719
- logger .error (" selection" , " Failed to send mini.files selection " .. file_path .. " : " .. (error_msg or " unknown error" ))
720
- end
721
-
722
- -- Send next file after a small delay
723
- if index < total_count then
724
- vim .defer_fn (function ()
725
- send_next_file (index + 1 )
726
- end , 200 ) -- 200ms delay between files
727
- else
728
- send_next_file (index + 1 ) -- Process final summary
729
- end
730
- end
731
-
732
- -- Start sending files
733
- send_next_file (1 )
734
- return true -- Return immediately, files are sent asynchronously
735
- end
736
-
737
662
local sel_to_send
738
663
739
664
-- If range parameters are provided, use them (for :'<,'> commands)
0 commit comments