mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Adds forgotten dispose & implements undo
This commit is contained in:
parent
225be1f83c
commit
ce36afc6c5
1 changed files with 11 additions and 6 deletions
|
|
@ -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(),
|
[
|
||||||
text: value,
|
{
|
||||||
}
|
range: this.model.getFullModelRange(),
|
||||||
], () => null);
|
text: value,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
() => 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue