fix indentation detection

This commit is contained in:
Luck
2022-01-09 20:37:39 +00:00
parent b4690bf89d
commit 7c69980837

View File

@@ -49,6 +49,15 @@ export default function EditorTextArea({
[setActualContent]
);
// detect indentation whenever new forced content is set
useEffect(() => {
if (!editor) {
return;
}
editor.getModel().detectIndentation(true, 2);
}, [editor, forcedContent])
return (
<EditorArea ref={editorAreaRef}>
<Editor
@@ -60,8 +69,6 @@ export default function EditorTextArea({
fontLigatures: true,
wordWrap: true,
renderLineHighlight: 'none',
detectIndentation: true,
tabSize: 2,
renderValidationDecorations: false,
}}
beforeMount={beforeMount}