fix regression in ace_popup

This commit is contained in:
nightwing 2014-09-21 00:04:01 +04:00
commit c62b0b134f

View file

@ -816,10 +816,15 @@ var VirtualRenderer = function(container, theme) {
// lines may have been pushed down. If so, the first screen row will not
// have changed, but the first actual row will. In that case, adjust
// scrollTop so that the cursor and onscreen content stays in the same place.
// TODO: find a better way to handle this, that works non wrapped case and doesn't compute layerConfig twice
if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) {
this.scrollTop = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;
changes = changes | this.CHANGE_SCROLL;
changes |= this.$computeLayerConfig();
var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight;
if (st > 0) {
// this check is needed as a workaround for the documentToScreenRow returning -1 if document.length == 0
this.scrollTop = st;
changes = changes | this.CHANGE_SCROLL;
changes |= this.$computeLayerConfig();
}
}
config = this.layerConfig;
// update scrollbar first to not lose scroll position when gutter calls resize