mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
parent
3e31b71648
commit
65edfbaca0
2 changed files with 4 additions and 4 deletions
|
@ -294,8 +294,8 @@ export function fillEditorsDragData(accessor: ServicesAccessor, resourcesOrEdito
|
|||
editor.encoding = textFileModel.getEncoding();
|
||||
}
|
||||
|
||||
// contents (only if dirty)
|
||||
if (typeof editor.contents !== 'string' && textFileModel.isDirty()) {
|
||||
// contents (only if dirty and not too large)
|
||||
if (typeof editor.contents !== 'string' && textFileModel.isDirty() && !textFileModel.textEditorModel.isTooLargeForHeapOperation()) {
|
||||
editor.contents = textFileModel.textEditorModel.getValue();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -433,8 +433,8 @@ export class FileEditorInput extends AbstractTextResourceEditorInput implements
|
|||
untypedInput.languageId = this.getLanguageId();
|
||||
untypedInput.contents = (() => {
|
||||
const model = this.textFileService.files.get(this.resource);
|
||||
if (model?.isDirty()) {
|
||||
return model.textEditorModel.getValue(); // only if dirty
|
||||
if (model?.isDirty() && !model.textEditorModel.isTooLargeForHeapOperation()) {
|
||||
return model.textEditorModel.getValue(); // only if dirty and not too large
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in a new issue