Skip to content

Commit ee9954d

Browse files
committed
debug: add filetype detection logging and buffer name fallback for mini.files
1 parent 9062397 commit ee9954d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lua/claudecode/selection.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,16 @@ function M.send_at_mention_for_visual_selection(line1, line2)
661661

662662
-- Special handling for mini.files: use integrations module instead of selection system
663663
local current_ft = vim.bo.filetype
664-
if current_ft == "minifiles" then
664+
local current_buf_name = vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())
665+
666+
-- Debug logging to see what we're detecting
667+
logger.debug("selection", "Filetype detection debug:")
668+
logger.debug("selection", " current_ft: '" .. tostring(current_ft) .. "'")
669+
logger.debug("selection", " current_buf_name: '" .. tostring(current_buf_name) .. "'")
670+
logger.debug("selection", " is minifiles?: " .. tostring(current_ft == "minifiles"))
671+
logger.debug("selection", " buf_name has minifiles?: " .. tostring(current_buf_name:match("^minifiles://") ~= nil))
672+
673+
if current_ft == "minifiles" or current_buf_name:match("^minifiles://") then
665674
local integrations = require("claudecode.integrations")
666675
local files, err = integrations.get_selected_files_from_tree()
667676

0 commit comments

Comments
 (0)