Skip to content

Commit 1d88ed3

Browse files
committed
Fix <C-d> and <C-u> on certain sites
1 parent 302568b commit 1d88ed3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

common/content/buffer.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -742,21 +742,19 @@ const Buffer = Module("buffer", {
742742
* Scrolls the buffer vertically 'scroll' lines.
743743
*
744744
* @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.
746746
* @param {number} count The multiple of 'scroll' lines to scroll.
747747
* @optional
748748
*/
749749
scrollByScrollSize: function (direction, count) {
750750
direction = direction ? 1 : -1;
751751
count = count || 1;
752-
let win = Buffer.findScrollableWindow();
753-
754-
Buffer.checkScrollYBounds(win, direction);
752+
let elem = Buffer.findScrollable(direction, false);
755753

756754
if (options["scroll"] > 0)
757755
this.scrollLines(options["scroll"] * direction);
758756
else // scroll half a page down in pixels
759-
win.scrollBy(0, win.innerHeight / 2 * direction);
757+
elem.scrollTop += elem.scrollHeight / 2 * direction;
760758
},
761759

762760
_scrollByScrollSize: function _scrollByScrollSize(count, direction) {

0 commit comments

Comments
 (0)