mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 02:26:04 +00:00
reveal cell is async
This commit is contained in:
parent
1d150d7168
commit
055662fd90
|
@ -592,7 +592,7 @@ export interface INotebookEditor {
|
|||
/**
|
||||
* Reveal cell into viewport.
|
||||
*/
|
||||
revealInView(cell: ICellViewModel): void;
|
||||
revealInView(cell: ICellViewModel): Promise<void>;
|
||||
|
||||
/**
|
||||
* Reveal cell into the top of viewport.
|
||||
|
|
|
@ -2066,7 +2066,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
}
|
||||
|
||||
revealInView(cell: ICellViewModel) {
|
||||
this._list.revealCell(cell, CellRevealType.Default);
|
||||
return this._list.revealCell(cell, CellRevealType.Default);
|
||||
}
|
||||
|
||||
revealInViewAtTop(cell: ICellViewModel) {
|
||||
|
@ -2347,7 +2347,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
const firstSelectionPosition = selectionsStartPosition[0];
|
||||
await this.revealRangeInViewAsync(cell, Range.fromPositions(firstSelectionPosition, firstSelectionPosition));
|
||||
} else {
|
||||
this.revealInView(cell);
|
||||
await this.revealInView(cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2385,11 +2385,11 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
|
|||
if (!options?.skipReveal) {
|
||||
if (typeof options?.focusEditorLine === 'number') {
|
||||
this._cursorNavMode.set(true);
|
||||
this.revealInView(cell);
|
||||
await this.revealInView(cell);
|
||||
} else if (options?.revealBehavior === ScrollToRevealBehavior.firstLine) {
|
||||
this.revealFirstLineIfOutsideViewport(cell);
|
||||
} else if (options?.revealBehavior === ScrollToRevealBehavior.fullCell) {
|
||||
this.revealInView(cell);
|
||||
await this.revealInView(cell);
|
||||
} else {
|
||||
this.revealInCenterIfOutsideViewport(cell);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ export interface INotebookCellList {
|
|||
getFocusedElements(): ICellViewModel[];
|
||||
getSelectedElements(): ICellViewModel[];
|
||||
scrollToBottom(): void;
|
||||
revealCell(cell: ICellViewModel, revealType: CellRevealType): void;
|
||||
revealCell(cell: ICellViewModel, revealType: CellRevealType): Promise<void>;
|
||||
revealCells(range: ICellRange): void;
|
||||
revealRangeInCell(cell: ICellViewModel, range: Selection | Range, revealType: CellRevealRangeType): Promise<void>;
|
||||
revealCellOffsetInCenter(element: ICellViewModel, offset: number): void;
|
||||
|
|
Loading…
Reference in a new issue