Skip to content

Commit 6091df0

Browse files
authored
Check for substring for selection context fallback logic (#160)
1 parent 20bfef4 commit 6091df0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/claudecode/selection.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ function M.update_selection()
128128
local current_buf = vim.api.nvim_get_current_buf()
129129
local buf_name = vim.api.nvim_buf_get_name(current_buf)
130130

131-
-- If the buffer name starts with "✻ [Claude Code]", do not update selection
132-
if buf_name and string.sub(buf_name, 1, string.len("✻ [Claude Code]")) == "✻ [Claude Code]" then
131+
-- If the buffer name starts with "term://" and contains "claude", do not update selection
132+
if buf_name and buf_name:match("^term://") and buf_name:lower():find("claude", 1, true) then
133133
-- Optionally, cancel demotion timer like for the terminal
134134
if M.state.demotion_timer then
135135
M.state.demotion_timer:stop()

0 commit comments

Comments
 (0)