提交 0a74ef0b 编写于 作者: B Benjamin Pasero

fix #12268

上级 558526d1
......@@ -60,20 +60,11 @@ function getCodeEditor(editorWidget: IEditor): ICommonCodeEditor {
}
function getTextModel(editorWidget: IEditor): IModel {
let textModel: IModel;
// Support for diff
const model = editorWidget.getModel();
if (model && !!(<IDiffEditorModel>model).modified) {
textModel = (<IDiffEditorModel>model).modified;
}
// Normal editor
else {
textModel = <IModel>model;
}
// make sure to resolve any possible diff editors to their modified side
editorWidget = getCodeEditor(editorWidget);
return textModel;
return editorWidget ? <IModel>editorWidget.getModel() : null;
}
function asFileOrUntitledEditorInput(input: any): UntitledEditorInput | IFileEditorInput {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册