mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue