Skip to content

Commit 4a2c156

Browse files
authored
Fix debug console sometimes not autoscrolling with wordwrap disabled. (microsoft#160623)
Fix microsoft#117674
1 parent 4ee6836 commit 4a2c156

File tree

1 file changed

+3
-1
lines changed
  • src/vs/workbench/contrib/debug/browser

1 file changed

+3
-1
lines changed

src/vs/workbench/contrib/debug/browser/repl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,9 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
588588

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

0 commit comments

Comments
 (0)