diff --git a/src/vs/workbench/services/editor/common/customEditorLabelService.ts b/src/vs/workbench/services/editor/common/customEditorLabelService.ts index ceb97268c12..648b1c9c079 100644 --- a/src/vs/workbench/services/editor/common/customEditorLabelService.ts +++ b/src/vs/workbench/services/editor/common/customEditorLabelService.ts @@ -177,6 +177,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito private getNthDirname(path: string, filename: string, n: number): string | undefined { // grand-parent/parent/filename.ext1.ext2 -> [grand-parent, parent] + path = path.startsWith('/') ? path.slice(1) : path; const pathFragments = path.split('/'); const length = pathFragments.length;