mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-07-05 11:00:53 +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', () => {
|
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(
|
function* iterateSymbols(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue