Hi,
I’m trying to style my editors using the below extensions and none of them seem to be working with MergeView. I have confirmed that both editor views are configured correctly when used outside of MergeView. How do I implement editor extensions when using MergeView?
const viewLeft = new EditorView({
state: EditorState.create({
doc: leftText,
extensions: generateExtensions(),
}),
parent: editorLeftRef.current,
});
const viewRight = new EditorView({
state: EditorState.create({
doc: rightText,
extensions: generateExtensions(),
}),
parent: editorRightRef.current,
});
const view = new MergeView({
a: viewLeft.state,
b: viewRight.state,
parent: ref.current,
});
My generate extensions function is.
const generateExtensions = () => {
const extensions: Extension[] = [
keymap.of(defaultKeymap),
syntaxHighlighting(getSyntaxLanguageColor(syntax)),
EditorState.readOnly.of(true),
lineNumbers(),
SUPPORTED_LANGUAGES[syntax],
EditorView.lineWrapping,
];
return extensions;
};