@@ -45,8 +45,8 @@ Scroller.prototype.setLines = function(newLines, offset) {
45
45
this . lines = newLines ;
46
46
this . lineOffset = offset ;
47
47
if ( this . sticky ) {
48
- this . startPosition = Math . max ( this . lineOffset , this . lineCount ( ) - this . visibleCount ) ;
49
48
this . endPosition = this . lineCount ( ) ;
49
+ this . startPosition = Math . max ( this . lineOffset , this . endPosition - this . visibleCount ) ;
50
50
if ( this . endPosition <= this . visibleCount ) {
51
51
// follow text during initial 50 lines
52
52
this . jumpToBottom = true ;
@@ -71,8 +71,8 @@ Scroller.prototype.lineCount = function(){
71
71
} ;
72
72
73
73
Scroller . prototype . reset = function ( ) {
74
- this . startPosition = Math . max ( 0 , this . lineCount ( ) - this . visibleCount ) ;
75
74
this . endPosition = Math . max ( 0 , this . lineCount ( ) ) ;
75
+ this . startPosition = Math . max ( 0 , this . endPosition - this . visibleCount ) ;
76
76
this . lineOffset = 0 ;
77
77
this . jumpToBottom = true ;
78
78
this . sticky = true ;
@@ -90,8 +90,8 @@ Scroller.prototype._renderVisible = function(){
90
90
if ( this . dirty && this . console ) {
91
91
const top = this . console . scrollTop ;
92
92
if ( this . sticky ) {
93
- this . startPosition = Math . max ( this . lineOffset , this . lineCount ( ) - this . visibleCount ) ;
94
93
this . endPosition = this . lineCount ( ) ;
94
+ this . startPosition = Math . max ( this . lineOffset , this . endPosition - this . visibleCount ) ;
95
95
}
96
96
this . console . innerHTML = this . _generateContent ( ) ;
97
97
if ( this . jumpToBottom ) {
0 commit comments