mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-12 01:28:01 +01:00
fix focus on closeWidget (#214289)
* fix focus on `closeWidget` * remove `disposeFromClose`
This commit is contained in:
@@ -105,9 +105,14 @@ export abstract class ReferencesController implements IEditorContribution {
|
||||
modelPromise.cancel();
|
||||
if (this._widget) {
|
||||
this._storageService.store(storageKey, JSON.stringify(this._widget.layoutData), StorageScope.PROFILE, StorageTarget.MACHINE);
|
||||
if (!this._widget.isClosing) {
|
||||
// to prevent calling this too many times, check whether it was already closing.
|
||||
this.closeWidget();
|
||||
}
|
||||
this._widget = undefined;
|
||||
} else {
|
||||
this.closeWidget();
|
||||
}
|
||||
this.closeWidget();
|
||||
}));
|
||||
|
||||
this._disposables.add(this._widget.onDidSelectReference(event => {
|
||||
|
||||
@@ -211,6 +211,7 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
|
||||
private _previewContainer!: HTMLElement;
|
||||
private _messageContainer!: HTMLElement;
|
||||
private _dim = new dom.Dimension(0, 0);
|
||||
private _isClosing = false; // whether or not a dispose is already in progress
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
@@ -231,7 +232,12 @@ export class ReferenceWidget extends peekView.PeekViewWidget {
|
||||
this.create();
|
||||
}
|
||||
|
||||
get isClosing() {
|
||||
return this._isClosing;
|
||||
}
|
||||
|
||||
override dispose(): void {
|
||||
this._isClosing = true;
|
||||
this.setModel(undefined);
|
||||
this._callOnDispose.dispose();
|
||||
this._disposeOnNewModel.dispose();
|
||||
|
||||
Reference in New Issue
Block a user