Skip to content

Commit

Permalink
fix: Remove extra whitespace in the untitled editor label
Browse files Browse the repository at this point in the history
  • Loading branch information
mixj93 committed Oct 3, 2020
1 parent 70a31b6 commit 7456428
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export class UntitledTextEditorModel extends BaseTextEditorModel implements IUnt
// we have no associated file path. In that case we
// prefer the file name as title.
if (this.configuredLabelFormat === 'content' && !this.hasAssociatedFilePath && this.cachedModelFirstLineWords) {
return this.cachedModelFirstLineWords;
// Normalize multiple whitespaces to a single whitespace for the untitled editor label
const normalizedFirstLineWords = this.cachedModelFirstLineWords.replace(/\s{2,}/g, ' ');
return normalizedFirstLineWords;
}

// Otherwise fallback to resource
Expand Down

0 comments on commit 7456428

Please sign in to comment.