Skip to content

Commit 561f521

Browse files
committed
for rename-file, show the new name more prominent, microsoft#77728
1 parent b84d08b commit 561f521

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

src/vs/workbench/contrib/bulkEdit/browser/bulkEditTree.ts

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,34 @@ class FileElementTemplate {
160160
this._localDisposables.add(dom.addDisposableListener(this._checkbox, 'change', (() => element.edit.updateChecked(this._checkbox.checked))));
161161
this._checkbox.checked = element.edit.isChecked();
162162

163-
this._label.setFile(element.uri, {
164-
matches: createMatches(score),
165-
fileKind: FileKind.FILE,
166-
fileDecorations: { colors: true, badges: false },
167-
});
168-
169-
// details
170163
if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
171-
this._details.innerText = localize('detail.rename', "(renaming to {0})", this._labelService.getUriLabel(element.edit.newUri, { relative: true }));
172-
} else if (element.edit.type & BulkFileOperationType.Create) {
173-
this._details.innerText = localize('detail.create', "(creating)");
174-
} else if (element.edit.type & BulkFileOperationType.Create) {
175-
this._details.innerText = localize('detail.del', "(deleting)");
164+
// rename: NEW NAME (old name)
165+
this._label.setFile(element.edit.newUri, {
166+
matches: createMatches(score),
167+
fileKind: FileKind.FILE,
168+
fileDecorations: { colors: true, badges: false },
169+
});
170+
171+
this._details.innerText = localize(
172+
'detail.rename', "(renaming from {0})",
173+
this._labelService.getUriLabel(element.uri, { relative: true })
174+
);
175+
176176
} else {
177-
this._details.innerText = '';
177+
// create, delete, edit: NAME
178+
this._label.setFile(element.uri, {
179+
matches: createMatches(score),
180+
fileKind: FileKind.FILE,
181+
fileDecorations: { colors: true, badges: false },
182+
});
183+
184+
if (element.edit.type & BulkFileOperationType.Create) {
185+
this._details.innerText = localize('detail.create', "(creating)");
186+
} else if (element.edit.type & BulkFileOperationType.Create) {
187+
this._details.innerText = localize('detail.del', "(deleting)");
188+
} else {
189+
this._details.innerText = '';
190+
}
178191
}
179192
}
180193
}

0 commit comments

Comments
 (0)