mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
This commit is contained in:
parent
6d45c3610a
commit
3062c19c90
|
@ -23,7 +23,11 @@ export class EditorHighlights<T> {
|
|||
vscode.workspace.onDidChangeTextDocument(e => this._ignore.add(e.document.uri.toString())),
|
||||
vscode.window.onDidChangeActiveTextEditor(() => _view.visible && this.update()),
|
||||
_view.onDidChangeVisibility(e => e.visible ? this._show() : this._hide()),
|
||||
_view.onDidChangeSelection(() => _view.visible && this.update())
|
||||
_view.onDidChangeSelection(() => {
|
||||
if (_view.visible) {
|
||||
this.update();
|
||||
}
|
||||
})
|
||||
);
|
||||
this._show();
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ export class Navigation {
|
|||
this._disposables.push(
|
||||
vscode.commands.registerCommand('references-view.next', () => this.next(false)),
|
||||
vscode.commands.registerCommand('references-view.prev', () => this.previous(false)),
|
||||
_view.onDidChangeSelection(() => this._ensureSelectedElementIsVisible()),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -31,20 +30,6 @@ export class Navigation {
|
|||
this._ctxCanNavigate.set(Boolean(this._delegate));
|
||||
}
|
||||
|
||||
private _ensureSelectedElementIsVisible(): void {
|
||||
if (this._view.selection.length === 0) {
|
||||
return;
|
||||
}
|
||||
const [item] = this._view.selection;
|
||||
const location = this._delegate?.location(item);
|
||||
if (!location) {
|
||||
return;
|
||||
}
|
||||
if (vscode.window.activeTextEditor?.document.uri.toString() !== location.uri.toString()) {
|
||||
this._open(location, true);
|
||||
}
|
||||
}
|
||||
|
||||
private _anchor(): undefined | unknown {
|
||||
if (!this._delegate) {
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in a new issue