From d24845f406d20f6dbac2f321b1c830ebb525ff96 Mon Sep 17 00:00:00 2001 From: Danny Su Date: Sat, 29 Nov 2025 20:32:41 -0800 Subject: [PATCH] Check for substring for selection context fallback logic --- lua/claudecode/selection.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/claudecode/selection.lua b/lua/claudecode/selection.lua index dfe20454..c10e8561 100644 --- a/lua/claudecode/selection.lua +++ b/lua/claudecode/selection.lua @@ -128,8 +128,8 @@ function M.update_selection() local current_buf = vim.api.nvim_get_current_buf() local buf_name = vim.api.nvim_buf_get_name(current_buf) - -- If the buffer name starts with "✻ [Claude Code]", do not update selection - if buf_name and string.sub(buf_name, 1, string.len("✻ [Claude Code]")) == "✻ [Claude Code]" then + -- If the buffer name starts with "term://" and contains "claude", do not update selection + if buf_name and buf_name:match("^term://") and buf_name:lower():find("claude", 1, true) then -- Optionally, cancel demotion timer like for the terminal if M.state.demotion_timer then M.state.demotion_timer:stop()