Fix ace editor tab size

This commit is contained in:
Misode
2022-02-17 15:59:45 +01:00
parent f76ea7f4f4
commit 554e2ee706

View File

@@ -108,8 +108,8 @@ export function SourcePanel({ name, model, blockStates, doCopy, doDownload, doIm
}, [model])
useEffect(() => {
const softTabs = indent === 'tabs' ? false : INDENT[indent]
editor.current.setOption('useSoftTabs', softTabs)
editor.current.setOption('useSoftTabs', indent !== 'tabs')
editor.current.setOption('tabSize', indent === 'tabs' ? 4 : INDENT[indent])
editor.current.getSession().setMode(`ace/mode/${format}`)
retransform.current()
}, [indent, format])