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