Skip to content

Commit 028241b

Browse files
author
Jackson Kearl
committed
Fix microsoft#98766 - Reloading a dirty saved search editor causes a phantom tab to appear
1 parent e4e4343 commit 028241b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class SearchEditorInput extends EditorInput {
108108

109109
const input = this;
110110
const workingCopyAdapter = new class implements IWorkingCopy {
111-
readonly resource = input.modelUri;
111+
readonly resource = input.backingUri ?? input.modelUri;
112112
get name() { return input.getName(); }
113113
readonly capabilities = input.isUntitled() ? WorkingCopyCapabilities.Untitled : 0;
114114
readonly onDidChangeDirty = input.onDidChangeDirty;

src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class SearchEditorModel {
3434
@IModeService private readonly modeService: IModeService) {
3535
this.onModelResolved = new Promise<ITextModel>(resolve => this.resolveContents = resolve);
3636
this.onModelResolved.then(model => this.cachedContentsModel = model);
37-
this.ongoingResolve = backupService.resolve(modelUri)
37+
this.ongoingResolve = backupService.resolve(existingData.backingUri ?? modelUri)
3838
.then(backup => modelService.getModel(modelUri) ?? (backup ? modelService.createModel(backup.value, modeService.create('search-result'), modelUri) : undefined))
3939
.then(model => { if (model) { this.resolveContents(model); } });
4040
}

0 commit comments

Comments
 (0)