fix regression in ace_popup
This commit is contained in:
parent
79eda6d2a8
commit
c62b0b134f
1 changed files with 8 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue