mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 08:15:05 +01:00
Do not close zone widget when showing it (#19460)
This commit is contained in:
@@ -141,7 +141,7 @@ export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewServ
|
||||
|
||||
public _doLayout(heightInPixel: number, widthInPixel: number): void {
|
||||
|
||||
if (heightInPixel < 0) {
|
||||
if (!this._isShowing && heightInPixel < 0) {
|
||||
// Looks like the view zone got folded away!
|
||||
this.dispose();
|
||||
this._onDidClose.fire(this);
|
||||
|
||||
@@ -182,12 +182,16 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout
|
||||
return undefined;
|
||||
}
|
||||
|
||||
protected _isShowing: boolean = false;
|
||||
|
||||
public show(rangeOrPos: IRange | IPosition, heightInLines: number): void {
|
||||
const range = Range.isIRange(rangeOrPos)
|
||||
? rangeOrPos
|
||||
: new Range(rangeOrPos.lineNumber, rangeOrPos.column, rangeOrPos.lineNumber, rangeOrPos.column);
|
||||
|
||||
this._isShowing = true;
|
||||
this._showImpl(range, heightInLines);
|
||||
this._isShowing = false;
|
||||
this._positionMarkerId = this.editor.deltaDecorations(this._positionMarkerId, [{ range, options: {} }]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user