Skip to content

refactor: extract tryCursorInsert helper from insertTemplateIntoTab#201

Open
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-72
Open

refactor: extract tryCursorInsert helper from insertTemplateIntoTab#201
JuliaKalder wants to merge 1 commit into
mainfrom
fix/issue-72

Conversation

@JuliaKalder
Copy link
Copy Markdown
Owner

Summary

  • Extract ~70-line cursor-mode insertion path into tryCursorInsert(tabId, body, existingDetails)
  • Helper tries executeScript inject (warn on fail), then sendMessage; returns null on success, fallback body string on failure
  • insertTemplateIntoTab cursor branch now calls tryCursorInsert and assigns details.body only when the return value is non-null
  • Pure refactor — no behaviour change

Fixes #72

🤖 Generated with Claude Code

Extract the ~70-line cursor-mode insertion path from insertTemplateIntoTab
into a dedicated async function tryCursorInsert(tabId, body, existingDetails).
The helper returns null on success or a fallback body string on failure.
Pure refactor — no behaviour change.

Co-Authored-By: Claude Sonnet 4.6 <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.

[MEDIUM] insertTemplateIntoTab: 70-line cursor-mode path with nested try/catch should be extracted into its own function

1 participant