MCPcopy Index your code
hub / github.com/codeaashu/claude-code / handleWrite

Function handleWrite

src/commands/copy/copy.tsx:222–238  ·  view source on GitHub ↗
(selected_1)

Source from the content-addressed store, hash-verified

220 let t6;
221 if ($[14] !== codeBlocks.length || $[15] !== getSelectionContent || $[16] !== messageAge || $[17] !== onDone) {
222 const handleWrite = async function handleWrite(selected_1) {
223 const content_0 = getSelectionContent(selected_1);
224 logEvent("tengu_copy", {
225 selected_block: content_0.blockIndex,
226 block_count: codeBlocks.length,
227 message_age: messageAge,
228 write_shortcut: true
229 });
230 ;
231 try {
232 const filePath = await writeToFile(content_0.text, content_0.filename);
233 onDone(`Written to ${filePath}`);
234 } catch (t7) {
235 const e = t7;
236 onDone(`Failed to write file: ${e instanceof Error ? e.message : e}`);
237 }
238 };
239 t6 = function handleKeyDown(e_0) {
240 if (e_0.key === "w") {
241 e_0.preventDefault();

Callers 1

CopyPickerFunction · 0.85

Calls 3

logEventFunction · 0.85
writeToFileFunction · 0.85
onDoneFunction · 0.50

Tested by

no test coverage detected