mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
[folding] check for disposed folding model
This commit is contained in:
parent
3add098871
commit
fb480ccf91
|
@ -207,7 +207,9 @@ export class FoldingController implements IEditorContribution {
|
|||
let selections = this.editor.getSelections();
|
||||
let selectionLineNumbers = selections ? selections.map(s => s.startLineNumber) : [];
|
||||
return this.getRangeProvider().compute(this.foldingModel.textModel).then(foldingRanges => {
|
||||
this.foldingModel.update(foldingRanges, selectionLineNumbers);
|
||||
if (this.foldingModel) { // null if editor has been disposed, or folding turned off
|
||||
this.foldingModel.update(foldingRanges, selectionLineNumbers);
|
||||
}
|
||||
return this.foldingModel;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue