This commit is contained in:
BeniBenj 2024-04-24 13:11:11 +02:00
parent 66c3c19192
commit 5b025ab496
No known key found for this signature in database
GPG key ID: 88390C5F13A9A253

View file

@ -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;