Skip to content

Commit 29db856

Browse files
authored
Fix file reveal on Windows (#8523)
* Fix file reveal on Windows * Merge branch 'main' into alexr00/nursing-mackerel * Merge branch 'main' into alexr00/nursing-mackerel * CCR feedback
1 parent 01fdbd4 commit 29db856

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/view/treeNodes/repositoryChangesNode.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ReviewModel } from '../reviewModel';
1515
import { CommitsNode } from './commitsCategoryNode';
1616
import { FilesCategoryNode } from './filesCategoryNode';
1717
import { BaseTreeNode, TreeNode } from './treeNode';
18+
import { compareIgnoreCase } from '../../common/utils';
1819

1920
export class RepositoryChangesNode extends TreeNode implements vscode.TreeItem {
2021
private _filesCategoryNode?: FilesCategoryNode;
@@ -91,7 +92,13 @@ export class RepositoryChangesNode extends TreeNode implements vscode.TreeItem {
9192
return;
9293
}
9394
if (this.parent.view.visible && activeEditorUri) {
94-
const matchingFile = this._reviewModel.localFileChanges.find(change => change.changeModel.filePath.toString() === activeEditorUri);
95+
const matchingFile = this._reviewModel.localFileChanges.find(change => {
96+
const changePath = change.changeModel.filePath.toString();
97+
if (process.platform === 'win32') {
98+
return compareIgnoreCase(changePath, activeEditorUri) === 0;
99+
}
100+
return changePath === activeEditorUri;
101+
});
95102
if (matchingFile && matchingFile.parent !== this.parent) {
96103
this.reveal(matchingFile, { select: true });
97104
}

0 commit comments

Comments
 (0)