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