handle hscrollbar change during autoresize
This commit is contained in:
parent
0db985a3d7
commit
93c39ca5b0
2 changed files with 19 additions and 8 deletions
|
|
@ -919,6 +919,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
(this.$minLines||1) * this.lineHeight,
|
||||
Math.min(maxHeight, height)
|
||||
) + this.scrollMargin.v + (this.$extraHeight || 0);
|
||||
if (this.$horizScroll)
|
||||
desiredHeight += this.scrollBarH.getHeight();
|
||||
var vScroll = height > maxHeight;
|
||||
|
||||
if (desiredHeight != this.desiredHeight ||
|
||||
|
|
@ -939,9 +941,6 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.$computeLayerConfig = function() {
|
||||
if (this.$maxLines && this.lineHeight > 1)
|
||||
this.$autosize();
|
||||
|
||||
var session = this.session;
|
||||
var size = this.$size;
|
||||
|
||||
|
|
@ -949,9 +948,6 @@ var VirtualRenderer = function(container, theme) {
|
|||
var screenLines = this.session.getScreenLength();
|
||||
var maxHeight = screenLines * this.lineHeight;
|
||||
|
||||
var offset = this.scrollTop % this.lineHeight;
|
||||
var minHeight = size.scrollerHeight + this.lineHeight;
|
||||
|
||||
var longestLine = this.$getLongestLine();
|
||||
|
||||
var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible ||
|
||||
|
|
@ -962,6 +958,12 @@ var VirtualRenderer = function(container, theme) {
|
|||
this.$horizScroll = horizScroll;
|
||||
this.scrollBarH.setVisible(horizScroll);
|
||||
}
|
||||
// autoresize only after updating hscroll to include scrollbar height in desired height
|
||||
if (this.$maxLines && this.lineHeight > 1)
|
||||
this.$autosize();
|
||||
|
||||
var offset = this.scrollTop % this.lineHeight;
|
||||
var minHeight = size.scrollerHeight + this.lineHeight;
|
||||
|
||||
var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd
|
||||
? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue