From 7c69980837e99ee7f0e4bca4bd8791f3cba47710 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 9 Jan 2022 20:37:39 +0000 Subject: [PATCH] fix indentation detection --- src/components/EditorTextArea.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/EditorTextArea.js b/src/components/EditorTextArea.js index 6d99903..694e900 100644 --- a/src/components/EditorTextArea.js +++ b/src/components/EditorTextArea.js @@ -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 (