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
const line = action.payload.line
const column = action.payload.column
editors.map((editor) => {
editor.revealLine(line)
editor.setPosition({ column, lineNumber: line })
})

@ -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"}
/>
<Editor
width="100%"

Loading…
Cancel
Save