pull/4791/head
filip mertens 6 months ago
parent c790b92a0c
commit 601a9f1a08
  1. 2
      libs/remix-ui/editor/src/lib/actions/editor.ts
  2. 14
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

@ -58,7 +58,9 @@ export const reducerActions = (models = initialState, action: Action) => {
if (!editors) return models if (!editors) return models
const line = action.payload.line const line = action.payload.line
const column = action.payload.column const column = action.payload.column
editors.map((editor) => { editors.map((editor) => {
editor.revealLine(line) editor.revealLine(line)
editor.setPosition({ column, lineNumber: line }) editor.setPosition({ column, lineNumber: line })
}) })

@ -631,12 +631,12 @@ export const EditorUI = (props: EditorUIProps) => {
} }
function setReducerListener() { function setReducerListener() {
if(!diffEditorRef.current && editorRef.current){ // if(!diffEditorRef.current && editorRef.current){
reducerListener(props.plugin, dispatch, monacoRef.current, [editorRef.current], props.events) // reducerListener(props.plugin, dispatch, monacoRef.current, [editorRef.current], props.events)
} // }
if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && !editorRef.current){ // if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && !editorRef.current){
reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor()], props.events) // reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor()], props.events)
} // }
if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && editorRef.current){ if(diffEditorRef.current && diffEditorRef.current.getModifiedEditor() && editorRef.current){
reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor(), editorRef.current], props.events) reducerListener(props.plugin, dispatch, monacoRef.current, [diffEditorRef.current.getModifiedEditor(), editorRef.current], props.events)
} }
@ -971,11 +971,11 @@ export const EditorUI = (props: EditorUIProps) => {
original={''} original={''}
modified={''} modified={''}
onMount={handleDiffEditorDidMount} onMount={handleDiffEditorDidMount}
beforeMount={handleEditorWillMount}
options={{ readOnly: false, renderSideBySide: isSplit }} options={{ readOnly: false, renderSideBySide: isSplit }}
width='100%' width='100%'
height={props.isDiff ? '100%' : '0%'} height={props.isDiff ? '100%' : '0%'}
className={props.isDiff ? "d-block" : "d-none"} className={props.isDiff ? "d-block" : "d-none"}
/> />
<Editor <Editor
width="100%" width="100%"

Loading…
Cancel
Save