Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff editor: Correct 1 files to 1 file #240092

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
/** @description Updates name */
const resources = this.resources.read(reader);
const label = this.label ?? localize('name', "Multi Diff Editor");
if (resources) {
this._name = label + localize({
key: 'files',
comment: ['the number of files being shown']
}, " ({0} files)", resources.length);
if (resources && resources.length === 1) {
this._name = localize({ key: 'nameWithOneFile', comment: ['{0} is the name of the editor'] }, "{0} (1 file)", label);
} else if (resources) {
this._name = localize({ key: 'nameWithFiles', comment: ['{0} is the name of the editor', '{1} is the number of files being shown'] }, "{0} ({1} files)", label, resources.length);
} else {
this._name = label;
}
Expand Down
Loading