mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-17 13:31:09 +00:00
Merge pull request #112 from remcohaszing/demo-dispose-old-model
Dispose the old model before switching in demo
This commit is contained in:
commit
4affa0963c
1 changed files with 4 additions and 1 deletions
|
|
@ -152,7 +152,10 @@ fetch('https://www.schemastore.org/api/json/catalog.json').then(async (response)
|
|||
});
|
||||
|
||||
select.addEventListener('change', () => {
|
||||
ed.setModel(editor.createModel(ed.getValue(), 'yaml', Uri.parse(select.value)));
|
||||
const oldModel = ed.getModel();
|
||||
const newModel = editor.createModel(oldModel.getValue(), 'yaml', Uri.parse(select.value));
|
||||
ed.setModel(newModel);
|
||||
oldModel.dispose();
|
||||
});
|
||||
|
||||
function* iterateSymbols(
|
||||
|
|
|
|||
Loading…
Reference in a new issue