File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -742,21 +742,19 @@ const Buffer = Module("buffer", {
742
742
* Scrolls the buffer vertically 'scroll' lines.
743
743
*
744
744
* @param {boolean } direction The direction to scroll. If true then
745
- * scroll up and if false scroll down .
745
+ * scroll down and if false scroll up .
746
746
* @param {number } count The multiple of 'scroll' lines to scroll.
747
747
* @optional
748
748
*/
749
749
scrollByScrollSize : function ( direction , count ) {
750
750
direction = direction ? 1 : - 1 ;
751
751
count = count || 1 ;
752
- let win = Buffer . findScrollableWindow ( ) ;
753
-
754
- Buffer . checkScrollYBounds ( win , direction ) ;
752
+ let elem = Buffer . findScrollable ( direction , false ) ;
755
753
756
754
if ( options [ "scroll" ] > 0 )
757
755
this . scrollLines ( options [ "scroll" ] * direction ) ;
758
756
else // scroll half a page down in pixels
759
- win . scrollBy ( 0 , win . innerHeight / 2 * direction ) ;
757
+ elem . scrollTop += elem . scrollHeight / 2 * direction ;
760
758
} ,
761
759
762
760
_scrollByScrollSize : function _scrollByScrollSize ( count , direction ) {
You can’t perform that action at this time.
0 commit comments