From 601a9f1a0847875f461dce4e8c61e9f8e10f8c38 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 4 Jun 2024 14:02:07 +0200 Subject: [PATCH] fix editor --- libs/remix-ui/editor/src/lib/actions/editor.ts | 2 ++ libs/remix-ui/editor/src/lib/remix-ui-editor.tsx | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/remix-ui/editor/src/lib/actions/editor.ts b/libs/remix-ui/editor/src/lib/actions/editor.ts index b367b79a2b..04774f6b57 100644 --- a/libs/remix-ui/editor/src/lib/actions/editor.ts +++ b/libs/remix-ui/editor/src/lib/actions/editor.ts @@ -58,7 +58,9 @@ export const reducerActions = (models = initialState, action: Action) => { if (!editors) return models const line = action.payload.line const column = action.payload.column + editors.map((editor) => { + editor.revealLine(line) editor.setPosition({ column, lineNumber: line }) }) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 32a2fcb3db..c0f2d25764 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -631,12 +631,12 @@ export const EditorUI = (props: EditorUIProps) => { } function setReducerListener() { - if(!diffEditorRef.current && editorRef.current){ - reducerListener(props.plugin, dispatch, monacoRef.current, [editorRef.current], props.events) - } - if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && !editorRef.current){ - reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor()], props.events) - } + // if(!diffEditorRef.current && editorRef.current){ + // reducerListener(props.plugin, dispatch, monacoRef.current, [editorRef.current], props.events) + // } + // if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && !editorRef.current){ + // reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor()], props.events) + // } if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && editorRef.current){ reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor(), editorRef.current], props.events) } @@ -971,11 +971,11 @@ export const EditorUI = (props: EditorUIProps) => { original={''} modified={''} onMount={handleDiffEditorDidMount} - beforeMount={handleEditorWillMount} options={{ readOnly: false, renderSideBySide: isSplit }} width='100%' height={props.isDiff ? '100%' : '0%'} className={props.isDiff ? "d-block" : "d-none"} + />