summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js')
-rw-r--r--public/js/syncscroll.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js
index 30ff43ce..8ca9f845 100644
--- a/public/js/syncscroll.js
+++ b/public/js/syncscroll.js
@@ -221,7 +221,7 @@ function buildMapInner(syncBack) {
if (t !== 0) {
nonEmptyList.push(t);
}
- _scrollMap[t] = Math.round($el.offset().top + offset);
+ _scrollMap[t] = Math.round($el.offset().top + offset - 10);
}
nonEmptyList.push(linesCount);
@@ -297,7 +297,7 @@ function syncScrollToView(event, _lineNo) {
var textHeight = editor.defaultTextHeight();
lineNo = Math.floor(scrollInfo.top / textHeight);
//if reach bottom, then scroll to end
- if (scrollInfo.height > scrollInfo.clientHeight && scrollInfo.top + scrollInfo.clientHeight >= scrollInfo.height - defaultTextHeight) {
+ if (scrollInfo.height > scrollInfo.clientHeight && scrollInfo.top + scrollInfo.clientHeight >= scrollInfo.height - textHeight) {
posTo = ui.area.view[0].scrollHeight - ui.area.view.height();
} else {
topDiffPercent = (scrollInfo.top % textHeight) / textHeight;