Adds forgotten dispose & implements undo

This commit is contained in:
Henning Dieterichs 2023-04-07 13:17:26 +02:00
parent 225be1f83c
commit ce36afc6c5
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06

View file

@ -448,12 +448,16 @@ class Editor extends React.Component<{
() => { () => {
const value = this.props.value.get(); const value = this.props.value.get();
if (!this.ignoreChange) { if (!this.ignoreChange) {
this.model.pushEditOperations(null, [ this.model.pushEditOperations(
null,
[
{ {
range: this.model.getFullModelRange(), range: this.model.getFullModelRange(),
text: value, text: value,
} },
], () => null); ],
() => null
);
} }
}, },
{ name: "update text" } { name: "update text" }
@ -463,6 +467,7 @@ class Editor extends React.Component<{
componentWillUnmount() { componentWillUnmount() {
this.disposables.forEach((d) => d.dispose()); this.disposables.forEach((d) => d.dispose());
this.model.dispose();
} }
} }