UNPKG

@readable-js/react-codemirror

Version:
23 lines 823 B
import { ViewPlugin } from "@codemirror/view"; import { readableMessages } from './readableMessages'; /** * * @param getCallStack * @param currentStep * @param skipEvaluation when forcing update with reconfigure, you don't want to execute the code again. */ export const readablePlugin = (getCallStack, currentStep, skipEvaluation) => { return ViewPlugin.fromClass(class { constructor(view) { this.decorations = readableMessages(view, getCallStack, currentStep, skipEvaluation); } update(update) { if (update.docChanged) { this.decorations = readableMessages(update.view, getCallStack, currentStep); } } }, { decorations: v => v.decorations, }); }; //# sourceMappingURL=readable-plugin.js.map