@@ -279,6 +279,12 @@ function M._get_mini_files_selection()
279
279
280
280
local bufnr = vim .api .nvim_get_current_buf ()
281
281
282
+ -- Debug logging
283
+ local logger = require (" claudecode.logger" )
284
+ logger .debug (" integrations" , " mini.files selection called" )
285
+ logger .debug (" integrations" , " bufnr: " .. tostring (bufnr ))
286
+ logger .debug (" integrations" , " mode: " .. tostring (vim .fn .mode ()))
287
+
282
288
-- Check if we're in visual mode for multi-selection
283
289
local mode = vim .fn .mode ()
284
290
if mode == " V" or mode == " v" or mode == " \22 " then
@@ -305,16 +311,25 @@ function M._get_mini_files_selection()
305
311
end
306
312
end
307
313
314
+ logger .debug (" integrations" , " Visual mode files found: " .. # files )
315
+ for i , file in ipairs (files ) do
316
+ logger .debug (" integrations" , " file " .. i .. " : " .. file )
317
+ end
318
+
308
319
if # files > 0 then
309
320
return files , nil
310
321
end
311
322
else
323
+ logger .debug (" integrations" , " Normal mode: getting file under cursor" )
312
324
-- Normal mode: get file under cursor
313
325
local entry_ok , entry = pcall (mini_files .get_fs_entry , bufnr )
314
326
if not entry_ok or not entry then
327
+ logger .debug (" integrations" , " Failed to get entry from mini.files" )
315
328
return {}, " Failed to get entry from mini.files"
316
329
end
317
330
331
+ logger .debug (" integrations" , " Entry found: " .. tostring (entry .path ))
332
+
318
333
if entry .path and entry .path ~= " " then
319
334
-- Extract real filesystem path from mini.files buffer path
320
335
local real_path = entry .path
@@ -323,15 +338,20 @@ function M._get_mini_files_selection()
323
338
real_path = real_path :gsub (" ^minifiles://[^/]*/" , " " )
324
339
end
325
340
341
+ logger .debug (" integrations" , " Real path: " .. tostring (real_path ))
342
+
326
343
-- Validate that the path exists
327
344
if vim .fn .filereadable (real_path ) == 1 or vim .fn .isdirectory (real_path ) == 1 then
345
+ logger .debug (" integrations" , " Path is valid, returning: " .. real_path )
328
346
return { real_path }, nil
329
347
else
348
+ logger .debug (" integrations" , " Path is invalid: " .. real_path )
330
349
return {}, " Invalid file or directory path: " .. real_path
331
350
end
332
351
end
333
352
end
334
353
354
+ logger .debug (" integrations" , " No file found under cursor" )
335
355
return {}, " No file found under cursor"
336
356
end
337
357
0 commit comments