MCPcopy
hub / github.com/braziljs/eloquente-javascript / revertCode

Function revertCode

src/client/ejs.mjs:241–247  ·  view source on GitHub ↗
(editor)

Source from the content-addressed store, hash-verified

239 }
240
241 function revertCode(editor) {
242 let context = editor.state.facet(contextFacet)
243 editor.dispatch({
244 selection: {anchor: 0},
245 changes: {from: 0, to: editor.state.doc.length, insert: context.orig.textContent}
246 })
247 }
248
249 function showEditorControls(editor) {
250 if (editor.dom.parentNode.querySelector(".editor-controls")) return

Callers 2

runFunction · 0.85
showEditorControlsFunction · 0.85

Calls 2

facetMethod · 0.80
dispatchMethod · 0.80

Tested by

no test coverage detected