Skip to content

Commit c900d82

Browse files
committed
Remove old editor pane
1 parent 5297476 commit c900d82

File tree

2 files changed

+3
-34
lines changed

2 files changed

+3
-34
lines changed

src/components/EditorPane.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/components/SplitEditor.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import SplitPane from "react-split-pane";
66

77
import { getSplitConfig, saveSplitConfig } from "../config.js";
88
import type { SupportedEngine, SupportedFormat } from "../rendering.js";
9-
import type EditorPane from "./EditorPane.js";
109

1110
const EditorLazy = lazy(() => import("./Editor.js"));
1211
const GraphPaneLazy = lazy(() => import("./GraphPane.js"));
@@ -44,7 +43,7 @@ export default class SplitEditor extends Component<
4443
SplitEditorProps,
4544
SplitEditorState
4645
> {
47-
#editorPaneRef = createRef<EditorPane>();
46+
#editorRef = createRef<monaco.editor.IStandaloneCodeEditor>();
4847

4948
constructor(props: SplitEditorProps) {
5049
super(props);
@@ -58,7 +57,7 @@ export default class SplitEditor extends Component<
5857
// Change the value of the underlying monaco instance
5958
// Monaco will call onChange and
6059
// the rest is going to be handled as if the user changed the value by hand
61-
this.#editorPaneRef.current?.loadValue(dotSrc);
60+
this.#editorRef.current?.setValue(dotSrc);
6261
}
6362

6463
dotSourceChanged = (dotSrc: string): void => {
@@ -77,8 +76,6 @@ export default class SplitEditor extends Component<
7776
const s = this.state;
7877
const p = this.props;
7978

80-
// <EditorPane ref={this.#editorPaneRef} />
81-
8279
return (
8380
<SplitPane
8481
split="vertical"
@@ -97,6 +94,7 @@ export default class SplitEditor extends Component<
9794
}
9895
>
9996
<EditorLazy
97+
ref={this.#editorRef}
10098
initialValue={s.dotSrc}
10199
onChangeValue={() => []}
102100
onValueError={n => void n}

0 commit comments

Comments
 (0)