Skip to content

Commit 4a38550

Browse files
blink-so[bot]ThomasK33
andcommitted
debug: add logging to diagnose tree buffer detection issue
- Add debug logging to show actual filetype and buffer name during visual selection - Improve tree buffer detection to include buffer name pattern matching - This will help identify why tree detection isn't working in neotree visual mode Co-authored-by: ThomasK33 <[email protected]>
1 parent 8d667d8 commit 4a38550

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lua/claudecode/init.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,19 @@ function M._create_commands()
254254

255255
-- Check if we're in a tree buffer - if so, delegate to tree integration
256256
local current_ft = vim.bo.filetype
257-
if current_ft == "NvimTree" or current_ft == "neo-tree" then
257+
local current_bufname = vim.api.nvim_buf_get_name(0)
258+
logger.debug(
259+
"command",
260+
"ClaudeCodeSend: Buffer detection - filetype: '" .. current_ft .. "', bufname: '" .. current_bufname .. "'"
261+
)
262+
263+
-- Check both filetype and buffer name for tree detection
264+
local is_tree_buffer = current_ft == "NvimTree"
265+
or current_ft == "neo-tree"
266+
or string.match(current_bufname, "neo%-tree")
267+
or string.match(current_bufname, "NvimTree")
268+
269+
if is_tree_buffer then
258270
logger.debug("command", "ClaudeCodeSend: Detected tree buffer, delegating to tree integration")
259271

260272
local integrations = require("claudecode.integrations")

0 commit comments

Comments
 (0)