Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix debug console sometimes not autoscrolling with wordwrap disabled. #160623

Merged
merged 1 commit into from Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/vs/workbench/contrib/debug/browser/repl.ts
Expand Up @@ -601,7 +601,9 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {

this._register(this.tree.onDidChangeContentHeight(() => {
if (this.tree.scrollHeight !== this.previousTreeScrollHeight) {
const lastElementWasVisible = this.tree.scrollTop + this.tree.renderHeight >= this.previousTreeScrollHeight;
// Due to rounding, the scrollTop + renderHeight will not exactly match the scrollHeight.
// Consider the tree to be scrolled all the way down if it is within 2px of the bottom.
const lastElementWasVisible = this.tree.scrollTop + this.tree.renderHeight >= this.previousTreeScrollHeight - 2;
if (lastElementWasVisible) {
setTimeout(() => {
// Can't set scrollTop during this event listener, the list might overwrite the change
Expand Down