Skip to content

Conversation

@oyoshot
Copy link

@oyoshot oyoshot commented Feb 1, 2026

Summary

  • Fix false positive neo-tree buffer detection that caused ClaudeCodeSend to fail in regular files whose buffer name includes neo-tree
  • Add unit tests covering buffer-name matching

Problem

:'<,'>ClaudeCodeSend fails when executed in a regular file whose name contains neo-tree (e.g. neo-tree.nvim.lua).

Repro:

  1. Open a regular file named neo-tree.nvim.lua
  2. Visually select some lines
  3. Run :'<,'>ClaudeCodeSend

Observed error:

ClaudeCode Error [ClaudeCode] [command] [ERROR] ClaudeCodeSend->TreeAdd: Not in a supported tree buffer (current filetype: lua)

Root Cause

The check string.match(current_bufname, "neo%-tree") matches any buffer name containing neo-tree, including regular files like /path/to/neo-tree.nvim.lua.

Solution

Restrict the buffer-name match to actual neo-tree buffers by anchoring the pattern to the beginning of the buffer name (e.g. neo-tree filesystem:/...).

Change:

string.match(current_bufname, "neo%-tree")string.match(current_bufname, "^neo%-tree%s")

Tests

  • Added unit tests for buffer-name matching
  • All tests pass
  • Verified the repro succeeds after the fix

oyoshot and others added 2 commits February 1, 2026 16:32
Two focused tests for the pattern change:
- Files with 'neo-tree' in path are NOT detected as tree buffers
- Actual neo-tree buffers (starting with 'neo-tree ') ARE detected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant