Skip to content

Commit

Permalink
Opening same file appends a suffix to the filename (fix #143414)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 25, 2022
1 parent 43d51a7 commit 37cf197
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/platform/files/browser/htmlFileSystemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ export class HTMLFileSystemProvider implements IFileSystemProviderWithFileReadWr
let handleId = `/${handle.name}`;

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

map.set(handleId, handle);
Expand Down

0 comments on commit 37cf197

Please sign in to comment.