Skip to content

Commit 37cf197

Browse files
committed
Opening same file appends a suffix to the filename (fix microsoft#143414)
1 parent 43d51a7 commit 37cf197

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/platform/files/browser/htmlFileSystemProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,11 @@ export class HTMLFileSystemProvider implements IFileSystemProviderWithFileReadWr
313313
let handleId = `/${handle.name}`;
314314

315315
// Compute a valid handle ID in case this exists already
316-
if (map.has(handleId)) {
316+
if (map.has(handleId) && !map.get(handleId)?.isSameEntry(handle)) {
317317
let handleIdCounter = 2;
318318
do {
319319
handleId = `/${handle.name}-${handleIdCounter++}`;
320-
} while (map.has(handleId));
320+
} while (map.has(handleId) && !map.get(handleId)?.isSameEntry(handle));
321321
}
322322

323323
map.set(handleId, handle);

0 commit comments

Comments
 (0)