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

Function setEditorValueAndClearUndo

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

Source from the content-addressed store, hash-verified

51
52/** Sets text AND clears Monaco's undo stack so Cmd+Z can't independently undo just text. */
53export function setEditorValueAndClearUndo(text: string) {
54 const editor = useEditorStore.getState().editor;
55 if (!editor) return;
56 const model = editor.getModel();
57 if (!model) return;
58 _isInternalWrite = true;
59 model.setValue(text);
60 _isInternalWrite = false;
61}
62
63export function updateModelMarkers() {
64 const { monaco, editor, markers } = useEditorStore.getState();

Callers 2

acceptDiffFunction · 0.90
useRunAiWithStoreFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected