my code:
// ...
const initCoderView = (doc: string) => {
return EditorState.create({
doc: doc || '',
extensions: [
EditorView.editable.of(false),
EditorState.readOnly.of(true), // not working
lineNumbers(),
basicSetup
],
});
};
// ...
const modifiedState = initCoderView(modifiedCode);
const originalState = initCoderView(originalCode);
const editor = new MergeView({
a: modifiedState,
b: originalState,
parent: ref.current,
highlightChanges: true,
});
//...
But it can be edited and lineNumbers do not displayed