Fixes #33412: Don't do smooth scrolling when moving the cursor up/down one line

This commit is contained in:
Alex Dima
2017-08-31 18:48:50 +02:00
parent 7aa36c621b
commit 779b4aeccb
@@ -239,7 +239,8 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
this._horizontalRevealRequest = null;
}
if (e.scrollType === ScrollType.Smooth) {
const scrollTopDelta = Math.abs(this._context.viewLayout.getCurrentScrollTop() - newScrollPosition.scrollTop);
if (e.scrollType === ScrollType.Smooth && scrollTopDelta > this._lineHeight) {
this._context.viewLayout.setScrollPositionSmooth(newScrollPosition);
} else {
this._context.viewLayout.setScrollPositionNow(newScrollPosition);