MCPcopy
hub / github.com/tone-row/flowchart-fun / writeToEditorSafe

Function writeToEditorSafe

app/src/lib/useEditorStore.ts:34–44  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

32/** Write text to the editor model via pushEditOperations (preserves undo stack).
33 * No-ops silently if the editor is not mounted. */
34export function writeToEditorSafe(text: string) {
35 const editor = useEditorStore.getState().editor;
36 if (!editor) return;
37 const model = editor.getModel();
38 if (!model) return;
39 model.pushEditOperations(
40 [],
41 [{ range: model.getFullModelRange(), text }],
42 () => null
43 );
44}
45
46let _isInternalWrite = false;
47

Callers 1

useRunAiWithStoreFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected