提交 187e3206 编写于 作者: A Alex Dima

Fixes #21857: Handle a ViewScrollRequestEvent in a single place

上级 0049138c
......@@ -516,7 +516,12 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp
this.outgoingEvents.emitScrollChanged(e);
return false;
}
public onScrollRequest(e: editorCommon.ICursorScrollRequestEvent): boolean {
public onScrollRequest(e: viewEvents.ViewScrollRequestEvent): boolean {
let currentScrollTop = this.layoutProvider.getScrollTop();
let newScrollTop = currentScrollTop + e.deltaLines * this._context.configuration.editor.lineHeight;
this.layoutProvider.setScrollPosition({
scrollTop: newScrollTop
});
return e.revealCursor ? this.revealCursor() : false;
}
private revealCursor(): boolean {
......
......@@ -197,14 +197,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
this.domNode.setWidth(e.scrollWidth);
return this._visibleLines.onScrollChanged(e) || true;
}
public onScrollRequest(e: viewEvents.ViewScrollRequestEvent): boolean {
let currentScrollTop = this._viewLayout.getScrollTop();
let newScrollTop = currentScrollTop + e.deltaLines * this._lineHeight;
this._viewLayout.setScrollPosition({
scrollTop: newScrollTop
});
return true;
}
public onTokensChanged(e: viewEvents.ViewTokensChangedEvent): boolean {
return this._visibleLines.onTokensChanged(e);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册