diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts index b0473db1459b35d8dbd380ee0bce049345955ba8..1b94c3756e813ddb646997af8c1410ec1cddbce6 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts @@ -399,16 +399,19 @@ class VSash { getVerticalSashHeight: () => this._height }); - let data: { startX: number, startRatio: number }; + // compute the current widget clientX postion since + // the sash works with clientX when dragging + let clientX: number; this._disposables.add(this._sash.addListener2('start', (e: ISashEvent) => { - data = { startX: e.startX, startRatio: this._ratio }; + clientX = e.startX - (this._width * this.ratio); })); this._disposables.add(this._sash.addListener2('change', (e: ISashEvent) => { - let {currentX} = e; - let newRatio = data.startRatio * (currentX / data.startX); - if (newRatio > .05 && newRatio < .95) { - this._ratio = newRatio; + // compute the new position of the sash and from that + // compute the new ratio that we are using + let newLeft = e.currentX - clientX; + if (newLeft > 20 && newLeft + 20 < this._width) { + this._ratio = newLeft / this._width; this._sash.layout(); this._onDidChangePercentages.fire(this); }