提交 e96df57f 编写于 作者: A Alex Dima

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

上级 ac60b3d2
......@@ -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: {} }]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册