lint scroll.js

page-down-up-bugfix
John McLear 2021-01-07 20:57:59 +00:00
parent a3e6a44643
commit 34c7fb0c46
1 changed files with 2 additions and 3 deletions

View File

@ -353,10 +353,9 @@ Scroll.prototype.movePage = function (direction) {
// linePosition contains top and bottom, might be useful
// if the buffer of a fixed value isn't working as intended
const linePosition = caretPosition.getPosition();
const buffer = 25;
// we need to remember that lineoffset needs to be removed too..
let offset = linePosition.bottom - viewport.top;
let lineHeight = linePosition.top - linePosition.bottom;
const offset = linePosition.bottom - viewport.top;
const lineHeight = linePosition.top - linePosition.bottom;
let pixelsToScroll = viewport.top - viewport.bottom + offset;
if (direction === 'up') {
// buffer pixels unscrolled our safety net here. You can't use the current or previous