fix indentation detection
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user