Open nkreiger opened 1 year ago
In client facing editors, sometimes you want to ensure certain values are always there, and cannot be removed by the user. You could hide them, however, sometimes if its code related the user might accidentally add them back.
I have written a workaround, around this
const ne = (start, stop) => EditorView.updateListener.of((viewUpdate) => { if (viewUpdate.docChanged) { if (viewUpdate.changes.touchesRange(start, stop)) { // rollback deletes, ignore create // rollback state nextTick(() => { input.value = props.rollback; }); } } }); // extensions const rego_extensions = [rego_lang(), ne(props.disableStart, props.disableStop)];
moving something along these lines to:
https://github.com/surmon-china/vue-codemirror/blob/609ef5b0425ffccd23bdf6598594cc6283d3e2bc/src/codemirror.ts#L14
based on props
Multiple combined editors.
No response
Clear and concise description of the problem
In client facing editors, sometimes you want to ensure certain values are always there, and cannot be removed by the user. You could hide them, however, sometimes if its code related the user might accidentally add them back.
Suggested solution
I have written a workaround, around this
moving something along these lines to:
https://github.com/surmon-china/vue-codemirror/blob/609ef5b0425ffccd23bdf6598594cc6283d3e2bc/src/codemirror.ts#L14
based on props
Alternative
Multiple combined editors.
Additional context
No response
Validations