Skip to content

Commit e89c96c

Browse files
committed
fixes #211522
1 parent b55887a commit e89c96c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/services/editor/common/customEditorLabelService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
139139
for (const pattern of this.patterns) {
140140
let relevantPath: string;
141141
if (root && !pattern.isAbsolutePath) {
142-
relevantPath = relativePath ?? getRelativePath(resourceDirname(root.uri), resource) ?? resource.path;
142+
relevantPath = relativePath = relativePath ?? getRelativePath(resourceDirname(root.uri), resource) ?? resource.path;
143143
} else {
144144
relevantPath = resource.path;
145145
}
@@ -186,7 +186,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
186186
if (n < 0) {
187187
nth = Math.abs(n) - 1;
188188
} else {
189-
nth = length - 1 - n - 1; // -1 for the filename, -1 for 0-based index
189+
nth = length - n - 1;
190190
}
191191

192192
const nthDir = pathFragments[nth];

0 commit comments

Comments
 (0)