From b3f9380ebd3feb3b6ef91873a1c6a3a1ddc56654 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 17 Dec 2021 12:56:48 -0500 Subject: [PATCH] prettier --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 112db3997..712086bbf 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -92,7 +92,7 @@ export function Root(props: IProps): React.ReactElement { const editorRef = useRef(null); const vimStatusRef = useRef(null); const [vimEditor, setVimEditor] = useState(null); - const [editor, setEditor] = useState(null); + const [editor, setEditor] = useState(null); const [filename, setFilename] = useState(props.filename ? props.filename : lastFilename); const [code, setCode] = useState(props.filename ? props.code : lastCode); const [decorations, setDecorations] = useState([]); @@ -327,11 +327,11 @@ export function Root(props: IProps): React.ReactElement { // @ts-expect-error window.require(["monaco-vim"], function (MonacoVim: any) { setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current)); - MonacoVim.VimMode.Vim.defineEx('write', 'w', function() { + MonacoVim.VimMode.Vim.defineEx("write", "w", function () { // your own implementation on what you want to do when :w is pressed save(); }); - MonacoVim.VimMode.Vim.defineEx('quit', 'q', function() { + MonacoVim.VimMode.Vim.defineEx("quit", "q", function () { save(); }); editor.focus(); @@ -345,8 +345,8 @@ export function Root(props: IProps): React.ReactElement { return () => { vimEditor?.dispose(); - } - }, [ options, editorRef, editor, vimEditor]) + }; + }, [options, editorRef, editor, vimEditor]); function onMount(editor: IStandaloneCodeEditor): void { // Required when switching between site navigation (e.g. from Script Editor -> Terminal and back) @@ -365,7 +365,7 @@ export function Root(props: IProps): React.ReactElement { lineNumber: lastPosition.lineNumber, column: lastPosition.column + 1, }); - + editorRef.current.focus(); } @@ -411,7 +411,7 @@ export function Root(props: IProps): React.ReactElement { // Toolbars are roughly 108px + vim bar 34px // Get percentage of space that toolbars represent and the rest should be the // editor - const editorHeight = 100 - (((108 + (options.vim ? 34 : 0)) / window.innerHeight) * 100); + const editorHeight = 100 - ((108 + (options.vim ? 34 : 0)) / window.innerHeight) * 100; return ( <> @@ -443,7 +443,14 @@ export function Root(props: IProps): React.ReactElement { options={{ ...options, glyphMargin: true }} /> - +