Skip to content

Commit 3062c19

Browse files
authored
1 parent 6d45c36 commit 3062c19

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

extensions/references-view/src/highlights.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export class EditorHighlights<T> {
2323
vscode.workspace.onDidChangeTextDocument(e => this._ignore.add(e.document.uri.toString())),
2424
vscode.window.onDidChangeActiveTextEditor(() => _view.visible && this.update()),
2525
_view.onDidChangeVisibility(e => e.visible ? this._show() : this._hide()),
26-
_view.onDidChangeSelection(() => _view.visible && this.update())
26+
_view.onDidChangeSelection(() => {
27+
if (_view.visible) {
28+
this.update();
29+
}
30+
})
2731
);
2832
this._show();
2933
}

extensions/references-view/src/navigation.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export class Navigation {
1818
this._disposables.push(
1919
vscode.commands.registerCommand('references-view.next', () => this.next(false)),
2020
vscode.commands.registerCommand('references-view.prev', () => this.previous(false)),
21-
_view.onDidChangeSelection(() => this._ensureSelectedElementIsVisible()),
2221
);
2322
}
2423

@@ -31,20 +30,6 @@ export class Navigation {
3130
this._ctxCanNavigate.set(Boolean(this._delegate));
3231
}
3332

34-
private _ensureSelectedElementIsVisible(): void {
35-
if (this._view.selection.length === 0) {
36-
return;
37-
}
38-
const [item] = this._view.selection;
39-
const location = this._delegate?.location(item);
40-
if (!location) {
41-
return;
42-
}
43-
if (vscode.window.activeTextEditor?.document.uri.toString() !== location.uri.toString()) {
44-
this._open(location, true);
45-
}
46-
}
47-
4833
private _anchor(): undefined | unknown {
4934
if (!this._delegate) {
5035
return undefined;

0 commit comments

Comments
 (0)