提交 b1db74a4 编写于 作者: J Johannes Rieken

keep focus really stable... #44414

上级 a7466c75
......@@ -174,12 +174,12 @@ export class ReferencesController implements editorCommon.IEditorContribution {
});
}
public goToNextOrPreviousReference(fwd: boolean) {
public async goToNextOrPreviousReference(fwd: boolean) {
let source = this._model.nearestReference(this._editor.getModel().uri, this._widget.position);
let target = this._model.nextOrPreviousReference(source, fwd);
let editorFocus = this._editor.isFocused();
this._gotoReference(target);
this._widget.setSelection(target);
await this._widget.setSelection(target);
await this._gotoReference(target);
if (editorFocus) {
this._editor.focus();
}
......@@ -200,16 +200,16 @@ export class ReferencesController implements editorCommon.IEditorContribution {
this._requestIdPool += 1; // Cancel pending requests
}
private _gotoReference(ref: Location): void {
private _gotoReference(ref: Location): TPromise<any> {
this._widget.hide();
this._ignoreModelChangeEvent = true;
const { uri, range } = ref;
this._editorService.openEditor({
return this._editorService.openEditor({
resource: uri,
options: { selection: range }
}).done(openedEditor => {
}).then(openedEditor => {
this._ignoreModelChangeEvent = false;
if (!openedEditor || openedEditor.getControl() !== this._editor) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册