Skip to content

Commit

Permalink
Backport PR #16084: Use smart scroll in debugger to minimize distra…
Browse files Browse the repository at this point in the history
…ction (#16122)

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and krassowski committed Apr 6, 2024
1 parent 550c1b1 commit 453f6e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/debugger/src/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@ export class DebuggerSources implements IDebugger.ISources {
if (focus) {
notebook.activeCellIndex = i;
if (notebook.activeCell) {
notebook.scrollToItem(notebook.activeCellIndex).catch(reason => {
// no-op
});
notebook
.scrollToItem(notebook.activeCellIndex, 'smart')
.catch(reason => {
// no-op
});
}
this._shell.activateById(notebookPanel.id);
}

editors.push(
Object.freeze({
get: () => cell.editor,
reveal: () => notebook.scrollToItem(i),
reveal: () => notebook.scrollToItem(i, 'smart'),
src: cell.model.sharedModel
})
);
Expand Down

0 comments on commit 453f6e6

Please sign in to comment.