fix beautify

This commit is contained in:
Olivier Gagnon 2021-08-25 16:14:47 -04:00
parent 79345a49b4
commit e2d74f9432
2 changed files with 5 additions and 3 deletions

File diff suppressed because one or more lines are too long

@ -189,11 +189,13 @@ export function Root(props: IProps): React.ReactElement {
}
function beautify(): void {
setCode(code => beautifyCode(code, {
if (editorRef.current === null) return;
const pretty = beautifyCode(code, {
indent_with_tabs: !options.insertSpaces,
indent_size: 4,
brace_style: "preserve-inline",
}));
});
editorRef.current.setValue(pretty);
}
function onFilenameChange(event: React.ChangeEvent<HTMLInputElement>): void {