From 517066a710ee79bfe0209b3283b772cf6153a951 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Mon, 20 Dec 2021 10:44:17 -0500 Subject: [PATCH] fix missed conflicts --- src/ScriptEditor/ui/ScriptEditorRoot.tsx | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index 2ac005306..7b4e8c494 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -45,6 +45,7 @@ interface IProps { hostname: string; player: IPlayer; router: IRouter; + vim: boolean; } // TODO: try to removve global symbols @@ -98,6 +99,9 @@ class OpenScript { export function Root(props: IProps): React.ReactElement { const editorRef = useRef(null); const monacoRef = useRef(null); + const vimStatusRef = useRef(null); + const [vimEditor, setVimEditor] = useState(null); + const [editor, setEditor] = useState(null); const [openScripts, setOpenScripts] = useState( window.localStorage.getItem('scriptEditorOpenScripts') !== null ? JSON.parse(window.localStorage.getItem('scriptEditorOpenScripts')!) : [] @@ -107,21 +111,6 @@ export function Root(props: IProps): React.ReactElement { window.localStorage.getItem('scriptEditorCurrentScript') !== null ? JSON.parse(window.localStorage.getItem('scriptEditorCurrentScript')!) : null ); -<<<<<<< HEAD -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 [filename, setFilename] = useState(props.filename ? props.filename : lastFilename); - const [code, setCode] = useState(props.filename ? props.code : lastCode); - const [decorations, setDecorations] = useState([]); - hostname = props.filename ? props.hostname : hostname; - if (hostname === "") { - hostname = props.player.getCurrentServer().hostname; - } -======= ->>>>>>> dev const [ram, setRAM] = useState("RAM: ???"); const [updatingRam, setUpdatingRam] = useState(false); const [decorations, setDecorations] = useState([]); @@ -131,7 +120,7 @@ export function Root(props: IProps): React.ReactElement { theme: Settings.MonacoTheme, insertSpaces: Settings.MonacoInsertSpaces, fontSize: Settings.MonacoFontSize, - vim: Settings.MonacoVim, + vim: props.vim || Settings.MonacoVim, }); useEffect(() => {