Do not close zone widget when showing it (#19460)

This commit is contained in:
Alex Dima
2017-02-24 17:56:50 +01:00
parent ac60b3d2c4
commit e96df57f95
2 changed files with 5 additions and 1 deletions
@@ -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: {} }]);
}